"pod update" 没有更新到最新版本

"pod update" doesn't update to latest version

这是我在项目中使用的 podfile:

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'

问题是 cocoapods 0.39 正在将 AFNetworking 更新到版本 2.5.4,这是错误的。最新版本是2.6.3 还有facebook SDK更新到4.4(最新是4.8)等等

我尝试删除 Pods 文件夹和 .lock 文件,但没有帮助

也尝试清理 cocoapods 缓存但没有帮助:

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.

我尝试了一个新的 pod,它让我得到了最新的

Update all pods
Updating local specs repositories
Analyzing dependencies
Downloading dependencies
Installing AFNetworking (2.6.3)
Generating Pods project
Integrating client project

[!] Please close any current Xcode sessions and use `AfnetworkingPodFic.xcworkspace` for this project from now on.
Sending stats
Pod installation complete! There is 1 dependency from the Podfile and 1 total pod installed.

尝试清除 Cocoapods 的缓存

你可以从下面找到方法

https://gist.github.com/mbinna/4202236

希望对您有所帮助:)

删除并重新安装 cocoapods 解决了问题:

MACMINI:myproject myusername$ sudo rm -fr ~/.cocoapods/repos/master
Password:
MACMINI:myproject myusername$ pod setup
Setting up CocoaPods master repo
Setup completed
MACMINI:myproject myusername$ cd ~/myproject/
MACMINI:myproject myusername$ pod update
Update all pods
Updating local specs repositories
Analyzing dependencies
Downloading dependencies
Installing AFNetworking 2.6.3 (was 2.5.4)
Installing Bolts 1.5.0 (was 1.2.0)
Using Countly (15.06.01)
Installing FBSDKCoreKit 4.8.0 (was 4.4.0)
Installing FBSDKLoginKit 4.8.0 (was 4.4.0)
Installing FBSDKShareKit 4.8.0 (was 4.4.0)
Installing GoogleMaps 1.10.5 (was 1.10.1)
Using MONActivityIndicatorView (0.0.3)
Using MagicalRecord (2.3.0)
Using NYXImagesKit (2.3)
Generating Pods project
Integrating client project
Sending stats
Sending stats
Pod installation complete! There are 9 dependencies from the Podfile and 10 total pods installed.

CocoaPods 无法获取最新版本的 pod 的原因之一可能是另一个需要较早版本的依赖项。

例如,假设 PodA 的最新版本是 2.6,并且您的 Podfile 中有:

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

你不知道的是,PodB 有以下依赖: "PodA": "~> 2.5.4"

当 CocoaPods 尝试满足依赖关系时,它会拒绝 PodA 的 2.6 版本,因为它无法满足对 PodB 的更强依赖约束。

解决此问题的一种方法是通过在 运行 "pod update"

之前设置以下环境变量,要求 CocoaPods 打印内部依赖图调试信息
export MOLINILLO_DEBUG=1

就我而言,Neon 不会为我更新。原来是部署目标的问题

已更改 platform :ios, '8.0'platform :ios, '10.0'

更新正常。

$ 广告连播更新

在终端中键入此命令,调用将所有 pod 更新到新版本

清除以下路径中的 pods 缓存并重新安装 pod。

~/Library/Caches/CocoaPods/

~/.cocoapods/repos/ibm-cocoapods-specs

请像下面这样更新您的 CocoaPods:

myComputer:desiredFolder Test$ pod update

安装最新的 cocoapods 对我有用。

sudo gem install cocoapods