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


当前回答

对我来说,它只是拥有两个同名的文件。

其他回答

我的问题是在Mojave中运行Xcode 10,并且在尝试运行我在更新到Xcode 10之前编写的单元测试时。

在我的例子中,我在运行TestTarget目标时遇到了这个问题。为了解决这个问题,我必须:

删除一个目标依赖项(在TestTarget >构建阶段>目标依赖项中)

因为除了我的TestTarget,我还有另外两个目标,它们都在运行相同的脚本,并在某个点上创建/复制文件。

这与Xcode 10 Build System Release Notes中提到的内容相冲突:

对于由多个构建命令生成的构建中的任何单个文件,都是错误。例如,如果两个目标各自从shell脚本阶段声明相同的输出文件,则将输出文件的声明分解到单个目标中。

新的更新后,我更新Xcode 10.1到10.2

我更新到Xcode 10.2后又出现了类似的问题。我有多个目标在通过项目:Target1和Target2,我解决了这个问题:

导航到编辑方案>构建和 从构建的目标中移除一个:取消Test下Target1的复选框,因为我知道Target2导入了Target1

还要注意的是,Target2的复选框在Test下保持选中状态

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

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

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

在开始之前,请注意我的项目使用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.

在检查构建日志时,我注意到一个警告:

note: Using new build system
note: Planning build
note: Constructing build description
Build system information
warning: The Copy Bundle Resources build phase contains this target's Info.plist file '/Users/<redacted>/Repositories/Whitesmith/optimize-ios/Carthage/Checkouts/WSStatusBarNotification/Miscellaneous/Info.plist'. (in target 'JDStatusBarNotification')

如果这是你的情况,那就去你的目标:

构建阶段 拷贝包资源 删除info.plist。