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


当前回答

我有一堆多个命令产生警告-不限于信息。在一个目标中复制。包括本地化资源和字符串文件,头文件等。

解决方案:删除目标成员中的所有重复项。

其他回答

多重生成错误是由我的隐藏文件(.gitkeep)触发的 仔细看看你的编译源,我相信这个文件在编译源中,但它显示为空行。它实际上没有说隐藏文件的名称,但我删除了空白行,它修复了这个问题,所以我怀疑项目导航器不显示隐藏文件。

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

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

这里是另一个工作解决方案:(如果你使用自定义Pods)

在截图中选择侧边栏中的“Pods”作为亮点。 单击Build Phase。展开“头”部分。有3个选项,公共,私人,项目 展开Public,检查是否有重复的文件。删除它。完成了! !

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

在Xcode 10中,它也适用于以前的版本

双击项目 你会看到下图 从左边选择目标 扩展拷贝包资源(0项) 删除产生错误的相应文件