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文件相关的错误,那么从“复制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.

其他回答

这里提出的解决方案没有一个对我有效。这主要归功于CocoaPods。我以前使用Cocoapods 1.3.1。简单地升级到1.5.3并不能立即解决这个问题。

我遵循的步骤是:

删除Podfile.lock 删除Pods目录 删除派生数据并清除 退出Xcode 将CocoaPods更新到1.5.3 运行pod安装 打开工作区和构建

我的错误是:

重复的输出文件 ' /用户/ home /图书馆/开发/ Xcode / DerivedData / myAppName-fawptgabysjowicvpeqydjniuovo /构建/产品/ Debug-iphoneos / myAppName.app / GoogleMaps.bundle” on task: PhaseScriptExecution [CP]拷贝Pods资源 /用户/ home /图书馆/开发/ Xcode / DerivedData / myAppName-fawptgabysjowicvpeqydjniuovo /构建/ Intermediates.noindex / myAppName.build Debug-iphoneos / myAppName.build / Script-32CCC25BF727B592A1784900.sh

我关注的问题文件是GoogleMaps。bundle和该文件在[CP]拷贝Pods资源中的位置,以及它指定它是一个重复的输出文件的事实(我在上面用黑色突出显示它们),这是下面的第四步

首先创建项目的副本,并确保在该副本上执行以下步骤

在项目导航器中,我找到了蓝色的项目图标

2-我选择构建阶段

3-在Build Phases下,我选择[CP] Copy Pods Resources

4-在[CP]拷贝Pods资源下,我去了输出文件,在那里我找到了以GoogleMaps.bundle结束的文件。我选中它,然后按负号删除它。确保你选择了输出文件而不是输入文件

5-我做了一个干净的shift+cmmd+k,之后当我建立项目时,错误就消失了

奇怪的是,即使红色错误消失了,黄色警告仍然存在,但它是有效的:)

对我来说,问题在于将同一个文件包含在bundle资源中两次。不知道这是怎么发生的,但我删除了其中一个,它与新的构建系统编译良好。

在我的例子中,问题来自podcast文件。我必须将我的测试项目添加到podfile:

target 'MyApp' do
    pod 'Firebase'
    target 'MyAppTests' do
        inherit! :search_paths
        pod 'Firebase'
    end
end

之后,我需要执行:

pod update

我的问题是我创建的动作扩展和主要目标的产品模块名称重复。解决方案是更改扩展的产品模块名称(在Build Settings下)。

(11) XCode