今天升級到了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”

屏幕快照 2018-09-19 上午8.53.42.png
分析:更新到Xcode10 版本需要CocoaPods版本>=1.4.0以上,可見Github上的一個issues Xcode10 beta can't load bundles from CocoaPods
解決問題:打開終端
查看當前系統(tǒng)Cocoapods版本命令:
pod --version
安裝更新:
pod setup
當執(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了,別著急,編譯項目還會報以下錯誤

解決:
請看截圖

屏幕快照 2018-09-25 上午9.59.01.png

屏幕快照 2018-09-25 上午9.55.39.png
運行項目,OK??