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


当前回答

我在用Core Data做实验。我为一个简单的检查表程序构建了一个数据模型,并生成了NSManagedObjects。当我编译项目时,我得到了以下错误:

error: Multiple commands produce '/Users/myUSerName/Library/Developer/Xcode/DerivedData/myCoreDateExperiment-gzbslaqdwglkzxemijpdqmizgyzc/Build/Intermediates.noindex/ myCoreDateExperiment /Debug-iphonesimulator/ myCoreDateExperiment.build/Objects-normal/x86_64/CheckListItem+CoreDataProperties.o':
1) Target ' myCoreDateExperiment ' (project ' myCoreDateExperiment ') has compile command for Swift source files
2) Target ' myCoreDateExperiment ' (project ' myCoreDateExperiment ') has compile command for Swift source files

问题在于数据模型(核对表)。xcdatamodeld(在我的例子中)在“编译源”列表中。当我从列表中删除该项目时,该项目编译干净。

打开项目导航器并选择项目(顶部的第一个条目) 在“项目和目标”窗格中的目标下选择您的构建目标 选择顶部附近的Build Phases选项 展开“Compile Sources”条目并查找数据模型名称。如果找不到,可以搜索“xcdatamodeld”。 从编译列表中删除模型 确保数据模型包含在“Copy Bundle Resources”列表中。如果缺少,请添加。

EDIT

@WilliamT。在评论中解释,您需要在编译列表中使用xcdatamodeld。相反,转到xcdatamodeld文件中的实体。选择出错的模型,展开左侧面板,并将“Codegen”字段更改为“Manual/None”。

其他回答

删除该死的资产文件

解决方案->打开目标->构建阶段>复制Bundle资源并从那里删除资产。

对我来说,是当我嵌入一个椰子足的框架时。您所需要做的就是将其从通用构建目标中的嵌入式内容选项卡中删除。

以防你在使用React Native时遇到这个错误,特别是在使用利比亚oga时。a,看看这条Github评论

问题: 在命令行中为Cocoapod项目创建xcodebuild存档时遇到错误。

控制台错误: 错误:多个命令产生'/Users/xxxx/Library/Developer/Xcode/DerivedData/…':

解决这个问题的步骤:

打开Xcode 在Xcode编辑器的顶部选择Scheme 选择编辑方案 在弹出窗口的左列中选择Build。 如果添加了与已编辑方案相关的目标以外的任何其他目标。 选择不相关的目标,并通过按“减号图标”删除它,并关闭弹出窗口。 在命令行中再次运行xcodebuild命令以解决问题。

图片说明:

步骤1:

步骤3:

步骤4 - 6:

在开始之前,请注意我的项目使用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.