错误描述
控制台出现 如此错误:
$ pod update
Update all pods
Updating local specs repositories
Analyzing dependencies
[!] Unable to satisfy the following requirements:
- `AFNetworking (~> 2.6.1)` required by `Podfile`
[!] CocoaPods was not able to update the `master` repo. If this is an unexpected issue and persists you can inspect it running `pod repo update --verbose`
意思大概说你运行一下“$ pod repo update –verbose”检查一下,我运行完一堆语句,我又不懂是什么鬼。
解决错误-solve
- $ pod search afnetworking
结果出来显示最新版本为2.5.2,所以改pod文件。即 pod ‘AFNetworking’, ‘~> 2.5.2’
-> AFNetworking (2.5.2)
A delightful iOS and OS X networking framework.
pod 'AFNetworking', '~> 2.5.2'
- Homepage: https://github.com/AFNetworking/AFNetworking
- Source: https://github.com/AFNetworking/AFNetworking.git
- Versions: 2.5.2, 2.5.1, 2.5.0, 2.4.1, 2.4.0, 2.3.1, 2.3.0, 2.2.4, 2.2.3,
2.2.2, 2.2.1, 2.2.0, 2.1.0, 2.0.3, 2.0.2, 2.0.1, 2.0.0, 2.0.0-RC3, 2.0.0-RC2,
2.0.0-RC1, 1.3.4, 1.3.3, 1.3.2, 1.3.1, 1.3.0, 1.2.1, 1.2.0, 1.1.0, 1.0.1,
1.0, 1.0RC3, 1.0RC2, 1.0RC1, 0.10.1, 0.10.0, 0.9.2, 0.9.1, 0.9.0, 0.7.0,
0.5.1 [master repo]
- Subspecs:
- AFNetworking/Serialization (2.5.2)
- AFNetworking/Security (2.5.2)
- AFNetworking/Reachability (2.5.2)
- AFNetworking/NSURLConnection (2.5.2)
- AFNetworking/NSURLSession (2.5.2)
- AFNetworking/UIKit (2.5.2)
- 反思错误
- 以后出现问题一步一步查问题
- 检查Podfile文件 检查 # platform :ios, ‘6.0’ 有没有指定版本
- 检查 库的版本。例子:前同事前两天问我Podfile里面这么写的,结果报错:
# platform :ios, '7.0'
pod 'Alamofire'
后来 我在控制台输入
$ pod search Alamofire
运行结果
Elegant HTTP Networking in Swift
pod 'Alamofire', '~> 1.1.4'
- Homepage: https://github.com/Alamofire/Alamofire
- Source: https://github.com/Alamofire/Alamofire.git
- Versions: 1.1.4, 1.1.3 [master repo]
似乎看不出来什么,去官网https://github.com/Alamofire/Alamofire看看,不出所料
over!