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


当前回答

如果你使用CocoaPods,你可能想要尝试分解pod并重新安装。这对我很管用。

赛事deintegrate

正在安装

其他回答

如果您手动创建实体的CoreDataClass和CoreDataProperties,请确保转到您的xcdatamodel并将检查器选项卡中的Codegen设置为“Manual/None”。如果设置为“类定义”,Xcode会自动为你创建一个重复的类。

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

如果你开发了私有cocoapod,并且已经通过Podfile添加了它,

从嵌入式二进制文件部分删除它:

不要启用遗留构建,你只是在隐藏问题

我有两个GoogleService-Info。请输入我的项目。必须删除旧的,并从构建阶段>>复制捆绑资源中删除它的条目

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

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

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