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'

在Xcode 9中运行代码正常,但在Xcode 10中有一个错误。


当前回答

在检查构建日志时,我注意到一个警告:

note: Using new build system
note: Planning build
note: Constructing build description
Build system information
warning: The Copy Bundle Resources build phase contains this target's Info.plist file '/Users/<redacted>/Repositories/Whitesmith/optimize-ios/Carthage/Checkouts/WSStatusBarNotification/Miscellaneous/Info.plist'. (in target 'JDStatusBarNotification')

如果这是你的情况,那就去你的目标:

构建阶段 拷贝包资源 删除info.plist。

其他回答

在检查构建日志时,我注意到一个警告:

note: Using new build system
note: Planning build
note: Constructing build description
Build system information
warning: The Copy Bundle Resources build phase contains this target's Info.plist file '/Users/<redacted>/Repositories/Whitesmith/optimize-ios/Carthage/Checkouts/WSStatusBarNotification/Miscellaneous/Info.plist'. (in target 'JDStatusBarNotification')

如果这是你的情况,那就去你的目标:

构建阶段 拷贝包资源 删除info.plist。

有时出现这个问题的原因是你有多个目标,这些目标有不同的iOS部署目标。检查你的目标(例如你的主应用目标和你的扩展)是否有相同的iOS部署目标。

在我的例子中,清理被剥夺的数据和构建设置(按此顺序),重新启动Xcode和模拟器有帮助。

我试图做解决方案->开放目标->构建阶段>复制捆绑资源,但它再次出现在那里。清理被剥夺的数据有帮助。在错误中,它显示了副本的位置,在我的情况下,它说它在我的应用程序包和被剥夺的数据中。

不要启用遗留构建,你只是在隐藏问题

我有两个GoogleService-Info。请输入我的项目。必须删除旧的,并从构建阶段>>复制捆绑资源中删除它的条目

不幸的是,这些答案对我都没用……这就是我看到的错误:

“多个命令生成/Users/…/…/…/Frameworks/abcdef.framework”

那个命令取决于命令……:脚本阶段"" 那个命令取决于命令……:脚本阶段""

将这一行添加到Podfile并进行“Pod Install”是唯一有效的方法。

install! 'cocoapods', :disable_input_output_paths => true

我真的希望这能帮助到一些人。我花了好几个小时才修好它。

有时候我真希望Xcode能像IntelliJ / Android Studio一样高效:(

古德勒克!