1罢缸、pod install時出現(xiàn)如下圖所示錯誤
> - Use the `$(inherited)` flag, or
>
> - Remove the build settings from the target.
按照上圖紅線標(biāo)注信息進行查找修改抗斤,以我的錯誤信息為例:
如下圖蹈垢,在MyStudySwiftTests的build setting中查找ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES,選擇other添加$(inherited)吗讶,編譯燎猛,重新pod install解決錯誤
2、mac系統(tǒng)更新導(dǎo)致cocoapods失效
解決辦法:
$ sudo gem update --system
$ sudo gem install cocoapods -n/usr/local/bin
3照皆、cocoapods搜索不到最新的三方庫
4重绷、cocoapods安裝時提示吐下信息
Automatically assigning platform ios
with version 9.0
on target XiaoFeiShang_Swift
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中platform前的#
符號
# Uncomment the next line to define a global platform for your project
platform :ios, '9.0'
target 'XiaoFeiShang_Swift' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for XiaoFeiShang_Swift
end
5、cocoapods搜索不到三方庫最新版本
pod cache clean --all
rm -rf ~/Library/Caches/CocoaPods
pod repo update
6膜毁、執(zhí)行pod install
時報錯
錯誤原因:如上圖所示昭卓,需要安裝的三方庫為Alamofire,版本為5.0.0-beta.2瘟滨,該版本最低支持的iOS target為10.0候醒,但我的podfile文件中platform版本是低于10.0的,所以報錯
修改方法:如下圖所示杂瘸,將platform后版本修改為10.0即可
7倒淫、錯誤信息如下:
cocoapods Pods/Pods/Target Support Files/Pods-xxx/Pods-xxx.debug.xcconfig: unable to open file (in target "xxx" in project "xxx") (in target 'xxx')
解決辦法一:
sudo gem install cocoapods --pre
如果執(zhí)行失敗,提示You don't have write permissions for the /usr/bin directory
败玉,使用方法二:
sudo gem install cocoapods -n/usr/local/bin --pre