成功pod install分享(本人在pod install失败后,研究成功后的总结)
安装CocoaPods成功后,先不急着编写Podfile。按以下顺序:
1、执行:pod search AFNetworking,会提示
Setting up CocoaPods master repo
耐心等待后,提示
Setup completed
-> AFNetworking (2.5.0)
A delightful iOS and OS X networking framework.
pod 'AFNetworking', '~> 2.5.0'
- Homepage: https://github.com/AFNetworking/AFNetworking
- Source: https://github.com/AFNetworking/AFNetworking.git
- Versions: 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]
- Sub specs:
- AFNetworking/Serialization (2.5.0)
- AFNetworking/Security (2.5.0)
- AFNetworking/Reachability (2.5.0)
- AFNetworking/NSURLConnection (2.5.0)
- AFNetworking/NSURLSession (2.5.0)
- AFNetworking/UIKit (2.5.0)
-> AFNetworking+AutoRetry (0.0.5)
Auto Retries for AFNetworking requests
pod 'AFNetworking+AutoRetry', '~> 0.0.5'
。。。(很长省略)
注意到AFNetworking 版本已经是2.5.0
2、创建Podfile
转到项目根目录,vi Podfile,输入内容(因为本人建的项目为ios8.1版本):
platform :ios, '8.1'
pod 'AFNetworking', '~> 2.5.0'
保存。
3、执行 pod install,稍等片刻
Analyzing dependencies
Downloading dependencies
Installing AFNetworking (2.5.0)
Generating Pods project
Integrating client project
[!] From now on use `Swift Weather.xcworkspace`.
成功pod install。