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


当前回答

如果你的错误是.app/(而不是.app/Info.plist),请看这里的答案:xcode 10错误:多个命令产生- react native

其他回答

在我的情况下,我有一个修改手表项目的应用程序和扩展都有一个信息。plist文件(都以相同的名字命名),为了解决这个问题,我重新命名了ios应用程序的文件,我把它作为信息。我将手表命名为watch_info。等等 之后,我在包装信息下修改了“项目->目标->构建设置”。Pilst并相应地修改了plist文件名,这为我解决了它

注意,我在其他地方看到在项目/工作区设置下将构建系统从新的更改为遗留的,尽管它有效-我不建议这样做,因为它会导致其他问题。

检查您支持的平台!

我们花了几个月的时间来研究这个问题。我们发现AVAILABLE_PLATFORMS被设置为“appletvos appletvsimulator iphoneos iphoneonesemulator macosx watchos watchsimulator”,这将导致构建多个平台,这将导致“多个命令产生错误”。例如,“Foo”平台正在为iOS和TVOS构建,因此多个构建命令正在创建一个Foo.framework文件。

我们一出发就去

AVAILABLE_PLATFORMS = iphoneos iphonesimulator

在我们的根xcconfig文件中,这个问题在所有子项目中都消失了。

检查您的配置

Run

xcodebuild -project FitbitMobile.xcodeproj -target "FitbitMobile" -showBuildSettings > BuildSettings.txt

查看输出是否被设置为您所期望的值。如果你是一款iOS应用,并且你正在为tvOS开发,你将需要更新你的配置。

这是我的错误信息:

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之前(归功于这个答案)。

在向应用程序添加了Fabric sdk套件的第二部分后,我遇到了这个问题。

实际发生的是GoogleUtilies框架被添加到Pods项目两次

这在Xcode 10之前是没问题的,但是如果一个文件有两个操作(在这种情况下是一个复制操作),Xcode 10就会报错。

去掉第二个框架是安全的。

值得注意的是,如果Codegen未设置为Manual/None,则在CoreData模型自动生成后可能会产生此错误。

要在Xcode 10中纠正这个问题,双击您的xcdatamodeId文件,选择每个实体,并在数据模型检查器的类下将Codegen设置为Manual/None。