"pod update"不会更新到最新版本

Ser*_*gio 15 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'
Run Code Online (Sandbox Code Playgroud)

问题是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.
Run Code Online (Sandbox Code Playgroud)

小智 14

在我的情况下,霓虹不会为我更新.事实证明这是因为部署目标.

改变 platform :ios, '8.0'platform :ios, '10.0'

并且更新正常工作.


Dav*_*yan 10

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

例如,假设PodA的最新版本是2.6,并且您的Podfile中包含以下文件:

pod 'PodA', '~> 2.0'
pod 'PodB'
Run Code Online (Sandbox Code Playgroud)

未知,PodB具有以下依赖性:“ PodA”:“〜> 2.5.4”

当CocoaPods尝试满足依赖性时,它将拒绝PodA的2.6版,因为它无法满足对PodB的较强依赖性。

解决此问题的一种方法是要求CocoaPods通过在运行“ pod update”之前设置以下环境变量来打印内部依赖关系图调试信息。

export MOLINILLO_DEBUG=1
Run Code Online (Sandbox Code Playgroud)


Vis*_*ngh 6

安装最新的 cocoapods 对我有用。

sudo gem install cocoapods
Run Code Online (Sandbox Code Playgroud)


Ser*_*gio -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.
Run Code Online (Sandbox Code Playgroud)