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


当前回答

选择您的方案(左上角)->编辑方案…->构建(左标签)->取消“查找隐式依赖”

在此之后,您可能需要修复目标未显式导入的任何依赖项。

其他回答

在我的例子中,我有我的GoogleService-info。Plist文件多次复制,因为它包括在我的主要应用程序和共享扩展项目。

解决方案是将该文件从扩展项目中排除(通过在其file Inspector侧窗口视图中的Target中取消选中该文件);因为我不喜欢切换到遗留构建系统的选项(这也适用于我)。

在我的例子中,构建存档错误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

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

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。

我在用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”。

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

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

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