今天剛升級(jí)到Xcode10凌箕,迫不及待運(yùn)行項(xiàng)目拧篮,結(jié)果1S我就回到冰點(diǎn),爆紅點(diǎn)牵舱。
網(wǎng)查發(fā)現(xiàn)解決方案串绩。網(wǎng)查的時(shí)候發(fā)現(xiàn)還有個(gè)問題似乎出現(xiàn)概率也挺高的,我就匯總一下芜壁,節(jié)省之后可能浪費(fèi)的時(shí)間礁凡。
雷區(qū)一、二是我自己出現(xiàn)的問題慧妄,其他還沒有實(shí)測(cè)顷牌,如果沒有解決你的問題,請(qǐng)自行找度娘塞淹。
雷區(qū)一:
Multiple commands produce
error: Multiple commands produce '/Users/xiaoyuan/Library/Developer/Xcode/DerivedData/Boobuz-gnxeuntgkenwgdgycqnvabqubafh/Build/Products/Debug-iphoneos/Boobuz.app':
1) Target 'Boobuz' has create directory command with output '/Users/xiaoyuan/Library/Developer/Xcode/DerivedData/Boobuz-gnxeuntgkenwgdgycqnvabqubafh/Build/Products/Debug-iphoneos/Boobuz.app'
2) That command depends on command in Target 'Boobuz': script phase “[CP] Copy Pods Resources”
分析error內(nèi)容窟蓝,錯(cuò)誤發(fā)生在Copy Pods Resources,而且與output有關(guān)饱普,應(yīng)該是使用了cocoapods導(dǎo)致的运挫,嘗試刪除該項(xiàng)目target-Copy Pods Resources-Output Files,成功解決問題套耕。
參考解決方案:Xcode 10 beta3 Error: Multiple commands produce
雷區(qū)二
ld: library not found for -lstdc++.6.0.9
clang: error: linker command failed with exit code 1 (use -v to see invocation)
項(xiàng)目用到了c++谁帕,依賴了libstdc++.6.0.9.tbd,導(dǎo)致整個(gè)工程編譯不通過,原因是蘋果在XCode10和iOS12中移除了libstdc++這個(gè)庫冯袍,由libc++這個(gè)庫取而代之,蘋果的解釋是libstdc++已經(jīng)標(biāo)記為廢棄有5年了匈挖,建議大家使用經(jīng)過了llvm優(yōu)化過并且全面支持C++11的libc++庫。
"libc++" C++ Standard Library
libc++和libstdc++
接下來更新這個(gè)庫就好了康愤,TARGETS—>Build Phases—>Link Binary With Libraries()
直接刪除儡循,然后添加libc++解決。
更多詳情查看Xcode10和iOS12適配
查找答案的時(shí)候發(fā)現(xiàn)報(bào)錯(cuò)ld: library not found for -lxxxx-ios-x.x.x之類的翘瓮,可能在合并或者其他操作的時(shí)候贮折,誤刪了這個(gè)庫,試試在這個(gè)路徑添加嘍资盅。
雷區(qū)三
:-1: Multiple commands produce '/Users/.../Library/Developer/Xcode/DerivedData/.../Build/Products/Dev-iphonesimulator/TLYShyNavBar/TLYShyNavBar.framework/Info.plist':
1) Target 'TLYShyNavBar' has copy command from '/Users/.../Desktop/Workspace/iOS/.../Pods/TLYShyNavBar/TLYShyNavBar/Info.plist' to '/Users/.../Library/Developer/Xcode/DerivedData/.../Build/Products/Dev-iphonesimulator/TLYShyNavBar/TLYShyNavBar.framework/Info.plist'
2) Target 'TLYShyNavBar' has process command with input '/Users/.../Desktop/Workspace/iOS/.../Pods/Target Support Files/TLYShyNavBar/Info.plist'
- In Xcode, go to File->Project/Workspace settings.
- Change the build system to Legacy Build system.
參考解決方案:Xcode10 Multiple commands produced error
雷區(qū)四
這個(gè)項(xiàng)目中并未用到调榄,直接刪除了文件踊赠。