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


当前回答

在我的情况下,一个信息。plist文件是从我的Cocoapods之一挖出来的。删除它,解决了问题。

其他回答

在开始之前,请注意我的项目使用Carthage作为依赖管理器。

这里没有一个现有的答案能解决我的问题。为我解决这个问题的方法如下。

First, I noticed that the build error pointed out one framework in particular. Next I filtered App Target > Build Phases for that framework. I noticed that that framework was present in both "Link Binary With Libraries" and "Embed Frameworks". Noting that none of the frameworks listed under "Embed Frameworks" were ones managed by Carthage I removed the framework in question from "Embed Frameworks". I then re-built my project and everything works fine including the functionality enabled by the framework in question.

步骤:

进入Xcode文件 点击进入工作区设置 生成系统选择为遗留生成系统

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

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

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

尝试所有这些选项,这3个选项中的任何一个都会为你工作,肯定的

Option 1: Remove all files from

目标>>构建阶段>>编译源代码 目标>>构建阶段>>拷贝Bundle资源

Option 2: Change the build system

Xcode->File->Project Settings-> Build System -> Legacy Build System

Option 3: remove and update existing pod

pod缓存清理PromisesObjC pod缓存清理承诺 cd [your_project_dir] rm -rf Pods/ rm Podfile.lock 豆荚更新

I hope this will help you, Happy coding :-)

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