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


当前回答

在我的案例中,PDFGenerator正在生成一个信息。plist文件,我刚刚删除了它。

其他回答

我是IOS开发的新手,我尝试了上面的答案,但它们对我不起作用。

我的XCode版本是12.4,Swift 5

我得到多个命令产生错误,而构建

我试图从错误列表中扩展错误,但双击它没有做什么,所以首先,我很难知道完整的错误。

所以我右键单击错误并复制到剪贴板,粘贴在文本编辑器中。

它显示了完整的错误

上面说哪部分有问题

Multiple commands produce '/Users/userName/Library/Developer/Xcode/DerivedData/ProjectName-fbeqffupediuiedlrplqjyhgyqna/Build/Products/Production-iphoneos/XCFrameworkIntermediates/GoogleAppMeasurement':
1) That command depends on command in Target 'GoogleAppMeasurement-iOS12.3' (project 'Pods'): script phase “[CP] Copy XCFrameworks”
2) That command depends on command in Target 'GoogleAppMeasurement-iOS14.1' (project 'Pods'): script phase “[CP] Copy XCFrameworks”

(我正在使用谷歌Firebase)

我很惊讶地看到,这些pod是为两个不同版本的iOS(12.3和14.1)编译的。

我发现,在活动目标配置中,我在部署信息部分设置了iOS 12.3,在项目级别信息选项卡的部署目标中设置了14.1

将两者设置为相同的所需版本,然后清理和构建解决了这个问题。

请让我知道设置2个不同的版本是否是一个错误。如果这不是一个错误,那么应该怎么做呢?

不允许我将构建系统设置为遗留系统 信息。plist在Copy Bundle Resources阶段不存在

没有遗留构建系统 如果你有这样的Podfile

def shared_pods
  pod 'X'
end

target 'A' do
  shared_pods
end

target 'B' do
  shared_pods
end

B也依赖于A然后像这样把B移到A

 target 'A' do

   shared_pods

   target 'B' do
     inherit! :search_paths
   end
 end

这是我的错误信息:

error: Multiple commands produce '/Users/runner/Library/Developer/Xcode/DerivedData/slapshot-ios-bpixgzdbgfcmofhguehgrznwbjxl/Build/Intermediates.noindex/ArchiveIntermediates/slapshot-ios-example/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/Introspect.framework'
    note: Target 'Introspect-dynamic' (project 'Pods') has create directory command with output '/Users/runner/Library/Developer/Xcode/DerivedData/slapshot-ios-bpixgzdbgfcmofhguehgrznwbjxl/Build/Intermediates.noindex/ArchiveIntermediates/slapshot-ios-example/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/Introspect.framework'
    note: Target 'Introspect-static' (project 'Pods') has create directory command with output '/Users/runner/Library/Developer/Xcode/DerivedData/slapshot-ios-bpixgzdbgfcmofhguehgrznwbjxl/Build/Intermediates.noindex/ArchiveIntermediates/slapshot-ios-example/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/Introspect.framework'

我必须添加:linkage =>:static到我的所有目标,而不仅仅是其中的一些,在运行pod deintegrate/pod install之前(归功于这个答案)。

我使用迦太基和Xcode 10。

我的解决方案是->项目->目标->一般->

从“嵌入式二进制文件”中删除添加了Carthage的框架

通常你必须在构建阶段添加一个脚本来剥离应用商店的架构。

在Xcode 10中,脚本似乎被称为always。所以它复制框架到正确的位置,你不需要将它们添加到常规选项卡。

注意:如果没有设置->在构建设置->搜索路径->框架搜索路径->设置路径为你添加的框架Carthage ....如。“$ (PROJECT_DIR) /迦太基/构建/ iOS”

我在plist上也有同样的问题。 结果我有两个副本,一个是空的,一个在我的本地化资源文件夹中。 去掉其中一个(空的)就解决了这个问题。

如果你检查你的错误,行1)和2)有不同的路径。在复制阶段,这个文件可能定义了两次。

检查你的目标属性,构建阶段,拷贝Bundle资源,并寻找一个重复的info.plist。找出不正确的路径并删除它。(您可能还想从文件系统中删除它。)