1、添加
pod init 添加Podfile,open Podfile 打开Podfile ,添加 pod 'AFNetworking' 即可。
2、出现以下警告:
[!] The `FounderReader-2.5 [Debug]` target overrides the `HEADER_SEARCH_PATHS` build setting defined in `Pods/Target Support Files/Pods-FounderReader-2.5/Pods-FounderReader-2.5.debug.xcconfig'. This can lead to problems with the CocoaPods installation
- Use the `$(inherited)` flag, or
- Remove the build settings from the target.
cocoapods与本地配置文件冲突。
解决方法:
找到 build Settings - 对应的警告地址(如,我的为HEADER SEARCH PATHS),添加$(inherited)
3、cocoapods添加的库不能在其他电脑同步,每次checkout 都需要install的问题
解决方法:
执行 pod update --verbose --no-repo-update更新下
4、出现以下警告:
[!] Automatically assigning platform `ios` with version `9.0` on target `FounderReader-2.5` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.
Podfile 没有指定iOS版本,或者填写错误
解决方法:
1)添加:platform :ios, '9.0'
注意,前面不需要“#”
2)更新:pod repo update
5、Setting up CocoaPods master repo 卡主不动
cd ~/.cocoapods/repos
将 链接:master下载 密码:ydqd 下载放在repos中,并将Specs 改为 master 即可。