Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"pod update" doesn't update to latest version

Here is my podfile I use in the project:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'
use_frameworks!

pod 'AFNetworking', '~> 2.0'
pod 'GoogleMaps'
pod 'MONActivityIndicatorView'
pod 'NYXImagesKit'
pod 'MagicalRecord'
pod 'FBSDKCoreKit'
pod 'FBSDKShareKit'
pod 'FBSDKLoginKit'
pod 'Countly'

The problem is that cocoapods 0.39 is updating AFNetworking to version 2.5.4 which is wrong. The latest version is 2.6.3 Also facebook SDK updating to 4.4 (latest is 4.8) etc.

I tried to delete Pods folder and .lock file but doesn't help

Also tried to clean the cocoapods cache but didn't help:

MACMINI:myproject myusername$ pod cache clean --all
MACMINI:myproject myusername$ pod update
Update all pods
Updating local specs repositories
Analyzing dependencies
Downloading dependencies
Installing AFNetworking (2.5.4)
Installing Bolts (1.2.0)
Installing Countly (15.06.01)
Installing FBSDKCoreKit (4.4.0)
Installing FBSDKLoginKit (4.4.0)
Installing FBSDKShareKit (4.4.0)
Installing GoogleMaps (1.10.1)
Installing MONActivityIndicatorView (0.0.3)
Installing MagicalRecord (2.3.0)
Installing NYXImagesKit (2.3)
Generating Pods project
Integrating client project

[!] Please close any current Xcode sessions and use `myproject.xcworkspace` for this project from now on.
Sending stats
Sending stats
Pod installation complete! There are 9 dependencies from the Podfile and 10 total pods installed.
like image 976
Serge Avatar asked Nov 24 '15 12:11

Serge


People also ask

How do you force a pod to update?

Add `--force` flag to `pod update` to force update a pod, even if this updates other pods as well · Issue #6359 · CocoaPods/CocoaPods · GitHub.

How do you update all pods?

Make sure your imagePullPolicy is set to Always(this is the default). That means when a pod is deleted, a new pod will ensure it has the current version of the image. Then refresh all your pods. The simplest way to refresh all your pods is to just delete them and they will be recreated with the latest image.

What is POD install repo update?

cocoapods-repo-update is a CocoaPods plugin that checks your dependencies when you run pod install and updates the local specs repositories if needed.


3 Answers

In my case, Neon wouldn't update for me. It turns out it was because of the deployment target.

Changed platform :ios, '8.0' to platform :ios, '10.0'

And update worked normally.

like image 69
Bojacob Avatar answered Sep 20 '22 14:09

Bojacob


One of the reasons CocoaPods won't pick up the latest version of the pod could be another dependency that required an earlier version.

For example, suppose the latest version of PodA is 2.6 and you have this in your Podfile:

pod 'PodA', '~> 2.0'
pod 'PodB'

Unbeknown to you, PodB has the following dependency: "PodA": "~> 2.5.4"

When CocoaPods tries to satisfy the dependencies, it will reject version 2.6 of PodA because it fails to satisfy the stronger dependency constraint on PodB.

One way to troubleshoot this is to ask CocoaPods to print the internal dependency graph debugging information by setting the following environment variable prior to running "pod update"

export MOLINILLO_DEBUG=1
like image 25
David Airapetyan Avatar answered Sep 18 '22 14:09

David Airapetyan


Installing latest cocoapods worked for me.

sudo gem install cocoapods
like image 26
Vishwas Singh Avatar answered Sep 20 '22 14:09

Vishwas Singh