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中有一个错误。


当前回答

有类似的问题,但与。swiftdoc文件。

我在项目中有扩展和单元测试目标。并且它们具有与应用程序相同的“产品模块名称”(Build Settings中的PRODUCT_MODULE_NAME)。在让名字独一无二之后,问题就消失了。

其他回答

在开始之前,请注意我的项目使用Carthage作为依赖管理器。

这里没有一个现有的答案能解决我的问题。为我解决这个问题的方法如下。

First, I noticed that the build error pointed out one framework in particular. Next I filtered App Target > Build Phases for that framework. I noticed that that framework was present in both "Link Binary With Libraries" and "Embed Frameworks". Noting that none of the frameworks listed under "Embed Frameworks" were ones managed by Carthage I removed the framework in question from "Embed Frameworks". I then re-built my project and everything works fine including the functionality enabled by the framework in question.

我有同一文件的多份副本。简单地说,保留一个副本,删除所有剩余的。清理构建,并对问题进行排序。

在我的情况下(我使用迦太基)的问题

error: Multiple commands produce 
1) Target *** has copy command from
2) That command depends on command in Target ***: script phase “Run Carthage Script” 

是由于在构建阶段配置中导入框架到嵌入式框架和运行迦太基脚本阶段造成的

这两个阶段复制框架到派生数据,所以Xcode看到重复的文件,打印这些错误并警告:

ignoring duplicated output file: (in target ***)

在从嵌入式框架阶段删除重复的框架之后,一切都正常工作了。

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

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。

在我的案例中,PDFGenerator正在生成一个信息。plist文件,我刚刚删除了它。