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


当前回答

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

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 ***)

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

其他回答

我有同样的问题,但与头文件。

在这种情况下,解决方案是将标题从“公共”部分移动到“项目”部分。

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

我的错误是:

重复的输出文件 ' /用户/ home /图书馆/开发/ Xcode / DerivedData / myAppName-fawptgabysjowicvpeqydjniuovo /构建/产品/ Debug-iphoneos / myAppName.app / GoogleMaps.bundle” on task: PhaseScriptExecution [CP]拷贝Pods资源 /用户/ home /图书馆/开发/ Xcode / DerivedData / myAppName-fawptgabysjowicvpeqydjniuovo /构建/ Intermediates.noindex / myAppName.build Debug-iphoneos / myAppName.build / Script-32CCC25BF727B592A1784900.sh

我关注的问题文件是GoogleMaps。bundle和该文件在[CP]拷贝Pods资源中的位置,以及它指定它是一个重复的输出文件的事实(我在上面用黑色突出显示它们),这是下面的第四步

首先创建项目的副本,并确保在该副本上执行以下步骤

在项目导航器中,我找到了蓝色的项目图标

2-我选择构建阶段

3-在Build Phases下,我选择[CP] Copy Pods Resources

4-在[CP]拷贝Pods资源下,我去了输出文件,在那里我找到了以GoogleMaps.bundle结束的文件。我选中它,然后按负号删除它。确保你选择了输出文件而不是输入文件

5-我做了一个干净的shift+cmmd+k,之后当我建立项目时,错误就消失了

奇怪的是,即使红色错误消失了,黄色警告仍然存在,但它是有效的:)

这个答案已经弃用了——Xcode 12已经弃用了遗留构建系统,它将在进一步的版本中被移除

我使用的是Xcode 11.4 不能构建旧项目

Xcode => File => Project Settings => Build System => Legacy Build System

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