今天升級到了Xcode 10堪遂,運行項目報錯黍翎,報錯如下:
error: Multiple commands produce '/Users/yangliubing/Library/Developer/Xcode/DerivedData/huiyuan-hjgquptyxlcqryafxstxxhsfeqeu/Build/Products/Debug-iphoneos/huiyuan.app':
1) Target 'huiyuan' has create directory command with output '/Users/yangliubing/Library/Developer/Xcode/DerivedData/huiyuan-hjgquptyxlcqryafxstxxhsfeqeu/Build/Products/Debug-iphoneos/huiyuan.app'
2) That command depends on command in Target 'huiyuan': script phase “[CP] Copy Pods Resources”
分析:更新到Xcode10 版本需要CocoaPods版本>=1.4.0以上奈嘿,可見Github上的一個issues Xcode10 beta can't load bundles from CocoaPods
解決問題:打開終端
查看當(dāng)前系統(tǒng)Cocoapods版本命令:
pod --version
安裝更新:
pod setup
當(dāng)執(zhí)行完以后再執(zhí)行
sudo gem install cocoapods
這個時候可能會出現(xiàn)報錯
While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /usr/bin directory.
改成如下命令即可
sudo gem install -n /usr/local/bin cocoapods
好了题禀,這時候cocoapods已經(jīng)更新到了最新的版本馍资,接下來就是把本地pod的第三方庫統(tǒng)統(tǒng)刪除竭沫,我是先把podfile里的第三方先刪掉燥翅,然后pod update,接著再把刪掉的comand+z,再pod update就OK了蜕提,別著急森书,編譯項目還會報以下錯誤
解決:
請看截圖
運行項目,OK??