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


当前回答

我在XCode 14.2中也面临同样的问题

错误说

多个命令生成“/Users/bhaveshparmar/Library/Developer/Xcode/DerivedData/App-cgedsyimmqlucmcodsrdnwzllkat/Build/Intermediates.noindex/App.build/development-iphone emulator /App.build/Objects-normal/x86_64/ThemeLabel.stringsdata”

这是因为我的源代码包含2个同名ThemeLabel的文件,所以删除了一个ThemeLabel,问题解决了。

其他回答

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

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

在我的例子中,我为两个不同的静态库使用了相同的自定义公共头文件夹路径。一个是主应用程序,另一个是手表应用程序。改变了手表应用程序的路径,现在一切正常。

对于那些依赖名称相同的Swift头导入的人。(例如:头文件名称:#import "MyApp-Swift.h"):

这个头文件的名称实际上是由${SWIFT_MODULE_NAME}-Swift.h决定的,其中SWIFT_MODULE_NAME使用PRODUCT_MODULE_NAME作为默认值。

此外,还有一个项目范围内的构建设置,名为:SWIFT_OBJC_INTERFACE_HEADER_NAME“Objective-C生成的接口头名称”,它的默认值是${SWIFT_MODULE_NAME}-Swift.h。通过将这个值更改为MyApp-Swift.h,我们聚合构建中的所有目标都能够共享相同的头名称,并且我们能够从它们中更改PRODUCT_MODULE_NAMEvalue。

我有同样的问题,但与头文件。

在这种情况下,解决方案是将标题从“公共”部分移动到“项目”部分。

如果你的应用程序生成了与多个.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.