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

时间:2015-11-24 12:21:39

标签: ios cocoapods afnetworking-2

这是我在项目中使用的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.

8 个答案:

答案 0 :(得分:12)

就我而言,霓虹灯不会为我更新。事实证明这是因为部署目标。

platform :ios, '8.0'platform :ios, '10.0'

更新工作正常。

答案 1 :(得分:7)

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

答案 2 :(得分:1)

安装最新的cocoapods对我有用。

sudo gem install cocoapods

答案 3 :(得分:0)

我尝试了一个新的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

希望有所帮助:)

答案 4 :(得分:0)

$ pod update

在终端输入此命令中,将所有pod更新为新版本

答案 5 :(得分:0)

清理以下路径中的pod缓存并再次执行pod安装。

〜/库/缓存/的CocoaPods /

〜/ .cocoapods /回购/ IBM-的CocoaPods-规范

答案 6 :(得分:0)

请更新您的CocoaPods,如下所示:

myComputer:desiredFolder Test$ pod update

答案 7 :(得分:-1)

删除并重新安装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.