升级到Xcode10以后,编译旧项目报错。
网上好多说更改::: 修改build system (感觉这种方式较好,不会每个项目搞一遍)在Xcode菜单栏 -> File -> Workspace Setting,将build system修改为legacy build system,然后clean后编译。(个人不喜欢这种方式。Xcode 新的功能用不了了。)
这个报错关键是知道为什么报错。
如: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”
仔细看后面
错误出在Copy Pods Resources,
根据error 日志,script phase “[CP] Copy Pods Resources”,而且与output有关,应该是使用了cocoapods导致的,尝试删除该项目target-Copy Pods Resources-Output Files,成功解决问题。选中项目target -> Build phase -> Copy Pods Resources -> Output Files -> 移除${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH} 然后重新编译,OK 。
然后可能还会报错,这时可能就会崩溃。不要急,再仔细看错误。下面附上别人的错误和自己的错误
:-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'
作者:狗狗臭鸡蛋
链接:https://www.jianshu.com/p/bb80d6d3724a
來源:简书
下面是自己的错误
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/旧工作项目/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/旧工作项目/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
删除重复的,留下一个。基本就可以了。