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


当前回答

在我的例子中,构建存档错误vs Xcode10

-1: Multiple commands produce '/Users/kk/Library/Developer/Xcode/DerivedData/react_carday_app-hjahojxsbvmmiyaklrhhuqljdfwv/Build/Intermediates.noindex/ArchiveIntermediates/react_carday_app/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/libyoga.a': 1) Target 'yoga' has a command with output '/Users/kk/Library/Developer/Xcode/DerivedData/react_carday_app-hjahojxsbvmmiyaklrhhuqljdfwv/Build/Intermediates.noindex/ArchiveIntermediates/react_carday_app/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/libyoga.a' 2) Target 'yoga' has a command with output '/Users/kk/Library/Developer/Xcode/DerivedData/react_carday_app-hjahojxsbvmmiyaklrhhuqljdfwv/Build/Intermediates.noindex/ArchiveIntermediates/react_carday_app/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/libyoga.a'

在你的Podfile中应该有类似bellow的东西

post_install do |installer|
  installer.pods_project.targets.each do |target|
    if target.name == "React"
      target.remove_from_project
    end

    if target.name == "yoga"
      target.remove_from_project
    end
  end
end

然后运行pod install

其他回答

如果你的应用程序生成了与多个.app文件相关的错误,那么从“复制bundle资源”中删除。plist文件将不起作用。

如果该错误与.app文件有关,请执行以下步骤

Select the Target. Go to Build Phases tab. Remove the items listed in Output Files Compile the code if it compiles successfully then not follow the next steps. If code does not compile successfully and Xcode may give you an error related to "Library not found". Then add the missing library in General Tab in Linked Frameworks and Libraries that Xcode mentioned in the error. Keep adding these libraries (that Xcode ask through compile errors) in Linked Frameworks and Libraries until the code compiles successfully. Hope this helps.

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

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

解决这个问题的步骤:

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

图片说明:

步骤1:

步骤3:

步骤4 - 6:

如果你在核心数据中遇到问题,这个答案适合你。 转到你的文件名。xcdatamodeld并确保所有实体都有manual/None Codegen。

我的错误是:

重复的输出文件 ' /用户/ 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,之后当我建立项目时,错误就消失了

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

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

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

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