升級(jí)到Xcode10以后,編譯舊項(xiàng)目報(bào)錯(cuò)。
網(wǎng)上好多說(shuō)更改:::?修改build system (感覺(jué)這種方式較好,不會(huì)每個(gè)項(xiàng)目搞一遍)在Xcode菜單欄 -> File -> Workspace Setting,將build system修改為legacy build system,然后clean后編譯。(個(gè)人不喜歡這種方式。Xcode 新的功能用不了了。)
這個(gè)報(bào)錯(cuò)關(guān)鍵是知道為什么報(bào)錯(cuò)。
如:error: Multiple commands produce '/Users/sicheng/Library/Developer/Xcode/DerivedData/ECON-ffztdzclstiiacdxhiipvpuswzhj/Build/Products/Debug-iphoneos/ECON.app':
1) Target 'ECON' has create directory command with output '/Users/sicheng/Library/Developer/Xcode/DerivedData/ECON-ffztdzclstiiacdxhiipvpuswzhj/Build/Products/Debug-iphoneos/ECON.app'
2) That command depends on command in Target 'ECON': script phase “[CP] Copy Pods Resources”
仔細(xì)看后面

錯(cuò)誤出在Copy Pods Resources,
根據(jù)error 日志,script phase “[CP] Copy Pods Resources”,而且與output有關(guān),應(yīng)該是使用了cocoapods導(dǎo)致的,嘗試刪除該項(xiàng)目target-Copy Pods Resources-Output Files,成功解決問(wèn)題。選中項(xiàng)目target -> Build phase -> Copy Pods Resources -> Output Files -> 移除${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}? 然后重新編譯,OK 。
然后可能還會(huì)報(bào)錯(cuò),這時(shí)可能就會(huì)崩潰。不要急,再仔細(xì)看錯(cuò)誤。下面附上別人的錯(cuò)誤和自己的錯(cuò)誤
:-1: Multiple commands produce'/Users/.../Library/Developer/Xcode/DerivedData/.../Build/Products/Dev-iphonesimulator/TLYShyNavBar/TLYShyNavBar.framework/Info.plist':1) Target'TLYShyNavBar'has copycommandfrom'/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 processcommandwith input'/Users/.../Desktop/Workspace/iOS/.../Pods/Target Support Files/TLYShyNavBar/Info.plist'
作者:狗狗臭雞蛋
鏈接:http://www.itdecent.cn/p/bb80d6d3724a
來(lái)源:簡(jiǎn)書(shū)
下面是自己的錯(cuò)誤
error: Multiple commands produce '/Users/sicheng/Library/Developer/Xcode/DerivedData/ECON-ffztdzclstiiacdxhiipvpuswzhj/Build/Products/Debug-iphoneos/ECON.app/ios-social-sdk-shake.html':
1) Target 'ECON' (project 'ECON') has copy command from '/Users/sicheng/Desktop/舊工作項(xiàng)目/IM版ECONDoc_v3.4.2 2/ECON/umeng/UMSocial_Sdk_4.2.1/UMSocial_Sdk_Extra_Frameworks/UMSocial_ScreenShot_Sdk/ios-social-sdk-shake.html' to '/Users/sicheng/Library/Developer/Xcode/DerivedData/ECON-ffztdzclstiiacdxhiipvpuswzhj/Build/Products/Debug-iphoneos/ECON.app/ios-social-sdk-shake.html'
2) Target 'ECON' (project 'ECON') has copy command from '/Users/sicheng/Desktop/舊工作項(xiàng)目/IM版ECONDoc_v3.4.2 2/ECON/umeng/UMSocial_Sdk_4.2.1/UMSocial_Sdk_Extra_Frameworks/UMSocial_Shake_Sdk/ios-social-sdk-shake.html' to '/Users/sicheng/Library/Developer/Xcode/DerivedData/ECON-ffztdzclstiiacdxhiipvpuswzhj/Build/Products/Debug-iphoneos/ECON.app/ios-social-sdk-shake.html'

看圖中的has copy command from 以及最后的ios-social-sdk-shake.html'。就是信息重加載了唄。
Solution - Open target > Build phase > Copy Bundle Resource/Compile Sources > removed 'ios-social-sdk-shake.html'?from here

刪除重復(fù)的,留下一個(gè)?;揪涂梢粤?。