项目在Xcode9中运行正常,但是在Xcode10的情况下,会报如下错误:
error: Multiple commands produce '/Users/uesr/Library/Developer/Xcode/DerivedData/OptimalLive-fxatvygbofczeyhjsawtebkimvwx/Build/Products/Debug-iphoneos/OptimalLive.app/Info.plist':
1) Target 'OptimalLive' has copy command from '/Users/uesr/Desktop/workSpace/SEALIVE/SeaLive1.1/OptimalLive/Info.plist' to '/Users/uesr/Library/Developer/Xcode/DerivedData/OptimalLive-fxatvygbofczeyhjsawtebkimvwx/Build/Products/Debug-iphoneos/OptimalLive.app/Info.plist'
2) Target 'OptimalLive' has copy command from '/Users/uesr/Desktop/workSpace/SEALIVE/SeaLive1.1/OptimalLive/Server/Masonry/Info.plist' to '/Users/uesr/Library/Developer/Xcode/DerivedData/OptimalLive-fxatvygbofczeyhjsawtebkimvwx/Build/Products/Debug-iphoneos/OptimalLive.app/Info.plist'
3) Target 'OptimalLive' has process command with input '/Users/uesr/Desktop/workSpace/SEALIVE/SeaLive1.1/OptimalLive/Info.plist'
这种问题的出现是因为组件化后把一些三方库和封装方法打成了一个私有库。修复流程如下:
1、依次点击[Xcode -> File ->Workspace Settings]菜单。打开如下窗口:
image.png
点击Build System tag下拉菜单,然后在弹出的菜单中选择 "Legacy Build System" 选项,最后点击 "Done"按钮。
2、使用"cmd+shift+alt+k" 快捷键Clean一下项目。
3、前往/Users/jerry/Library/Developer/Xcode/DerivedData目录,清除目录中的内容。
经过以上三个步骤即可解决这个Xcode10带来的问题。
网友评论