791
votes

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'

Running the code in Xcode9 works, but there is a error in Xcode10.

30
For cocoapods managed dependencies, refer to stackoverflow.com/a/52421345/334999Shuo
happens when you import third-party framework to your project and it has info.plist in it's source files. This info.plist conflicts with your app's one. Just remove it from Build phasesprotspace
Dear reader, read EVERY answer to this question, there are many different things that may be wrong.iluvcapra
Goto path "Build Phases->Copy Bundle Resources". Check for file name and delete the same. Clean and run the apllicationSagar Sukode

30 Answers

1591
votes

The issue might be occurring because of multiple Plist or other files within App-

Solution -> Open target -> Build phases > Copy Bundle Resources and remove info.plist from there.

enter image description here

Note: If you have developed a watch app too then you will have to remove the plist from the watch and watch-extension too.

604
votes

I found the solution for this build error, for anybody else having the same issue with Xcode 10 build system, follow the following steps to fix it:

  1. In Xcode, go to File->Project/Workspace settings.
  2. Change the build system to Legacy Build system.

enter image description here It will resolve the build issue with the new Xcode 10.

If you want to work with the new build system, then you can find the troubleshooting help from this apple Xcode help page.

Hope this helps!

175
votes

Go to Xcode -> File ->Workspace Settings. You will find one pop up like.

enter image description here

Select "Legacy Build System" from Build System tag. Press on "Done"

Note:- Make sure clear your project with "cmd+shift+alt+k" and "Derived Data"

Build your project it will work charm :)

131
votes

I was experimenting with Core Data. I built a data model for a simple checklist program and generated the NSManagedObjects. When I compiled the project I got the following error:

error: Multiple commands produce '/Users/myUSerName/Library/Developer/Xcode/DerivedData/myCoreDateExperiment-gzbslaqdwglkzxemijpdqmizgyzc/Build/Intermediates.noindex/ myCoreDateExperiment /Debug-iphonesimulator/ myCoreDateExperiment.build/Objects-normal/x86_64/CheckListItem+CoreDataProperties.o':
1) Target ' myCoreDateExperiment ' (project ' myCoreDateExperiment ') has compile command for Swift source files
2) Target ' myCoreDateExperiment ' (project ' myCoreDateExperiment ') has compile command for Swift source files

The problem was the data model (CheckList.xcdatamodeld in my case) was in the "Compile Sources" list. The project compiled cleanly when I removed it from the list.

  1. Open the project navigator and select the project (very first entry at the top)
  2. Select your build target under Targets in the "Projects and Targets" pane
  3. Select Build Phases option near the top
  4. Expand the "Compile Sources" entry and look for your data model name. Search for "xcdatamodeld" if you have trouble finding it.
  5. Delete the model from the compile list
  6. Make sure the data model is included in the "Copy Bundle Resources" list. Add it if it is missing.

EDIT

As @WilliamT. explains in the comments, you need the xcdatamodeld in the compile list. Instead, go to your entities within the xcdatamodeld file. Select the models that are erroring, expand the left panel, and change the field of "Codegen" to "Manual/None".

114
votes

Try this as well. Xcode->File->Project Settings-> Build System -> Legacy Build System.

77
votes

If you are getting this from the Ditto command creating multiple instances of the same name (NOT the 'copy files' build phase), you may have to change the Product Module Name.

  1. Click on your Target(s) Xcode is complaining about
  2. Click on Build Settings
  3. Search for Product Module Name
  4. Change the name to something unique

We have a watch target and a few notification targets in our app, so I just put things like Extension on the end of the module name.

I found this solution originally here: https://forums.developer.apple.com/thread/103913

43
votes

If you use CocoaPods you may want to try deintegrate the pods and install again. It works for me.

pod deintegrate

pod install

42
votes

While checking the build log, I noticed a warning:

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')

So, if that's your case then just go to your target:

  1. Build Phases
  2. Copy Bundle Resource
  3. Remove info.plist.
34
votes

Read this answer if error message references Core Data files

Synopsis: You may have both automatically-generated and manually-generated Core Data managed object class files.

This answer applies if the first line of the error refers to a Foo+CoreDataProperties.o or Foo+CoreDataClass.o file. Example:

error: Multiple commands produce '/Users/me/Library/Developer/Xcode/DerivedData/MyApp-uebslaqdwgldkjemijpdqmizgyzc/Build/Intermediates.noindex/ MyApp /Debug-iphonesimulator/ MyApp.build/Objects-normal/x86_64/Foo+CoreDataProperties.o':

1) Target ' MyApp ' (project ' MyApp ') has compile command for Swift source files

2) Target ' MyApp ' (project ' MyApp ') has compile command for Swift source files

The root cause can be seen by expanding the Compile Swift Source Files section of the Build Transcript. For example:

<unknown>:0: error: filename "Address+CoreDataClass.swift" used twice: '/Users/myUserName/Projects/Jnky/Foo+CoreDataProperties' and '/Users/jk/myUserName/Developer/Xcode/DerivedData/MyApp-uebslaqdwgldkjemijpdqmizgyzc/Build/Intermediates.noindex/MyApp.build/Debug/MyApp.build/DerivedSources/CoreDataGenerated/Jnky/Foo+CoreDataProperties.swift'

The first file mentioned there is a source file in your project directory, which someone generated by selecting your data model in the Project Navigator and clicking in the menu Editor > Create Managed Object Subclass. This feature was added in Xcode 7 or so.

The second file is a file of the same name but which is buried in Xcode's DerivedData. This file is generated automatically by Xcode during every build if the data model (.xcdatamodeld) file is included in the target's Compile Sources build phase. This feature was added in Xcode 9 or so. Zero, one or two files are generated for each entity/class, depending on the setting of the Codegen popup. That popup is in the Data Model Inspector when you select an entity while editing your data model…

screenshot of Data Model Inspector

The settings are:

  • Manual/None No files are generated
  • Category/Extension One file, Foo+CoreDataProperties.m or .swift is generated, containing an Objective-C category or Swift extension.
  • Class Definition That same Category/Extension file is generated, and in addition a Foo+CoreDataClass.m or .swift is generated, containing class declaration and definition.

So you see the problem occurs when a developer (like me) who is accustomed to the older Xcode begins a project in a newer Xcode. We think that we need to use the Create Managed Object Subclass menu item, which we do, to create the files we can see in the Project Navigator while not realizing that our settings in the Codegen popup are causing Xcode to create duplicate files, which Apple "cleverly" does not show in the Project Navigator, because they don't trust developers to read and heed the comment in the header // This file was automatically generated and should not be edited.

Solution 1 - Use the Older Way

You can disable all automatic Codegen for a data model with just one setting:

  • Open the problem Target's Build Phases (In Project Navigator, select project, then in list of TARGETS which appears, select the problem target, then tab Build Phases).
  • Expand the Compile Sources entry and find the problem data model (.xcdatamodeld file).
  • Delete it from the compile list
  • Ensure the data model is included in the Copy Bundle Resources list.

Solution 2 - Core Data Magic For Beginners

Here, you go all in on the newer way.

  • Leave your data model as is in that Compile Sources.
  • In each Entity Inspector in your data model, set Codegen to Class Definition.
  • In the Project Navigator, delete and trash any Foo+CoreDataClass files, and rename any Foo+CoreDataProperties.m or .swift files to something like Foo+MyProperties.
  • In each Foo+MyProperties.m or .swift file, if there are properties generated by Xcode, delete these properties because they will be in the hidden files created by Codegen.

With this solution, your class definitions are generated automatically from the data model on each build. You can't even see them. It is Core Data Magic, nice and simple for beginners.

Solution 3 - For Most Real-World Apps

But Solution 2 is no good if you really want to add non-managed properties. (Objective-C does not allow properties to be added in categories, and Swift does not allow stored properties to be added in extensions.) So in most real-world apps, you probably want to go halfway between Solutions 1 and 2…

  • Leave your data model in the list of Compile Sources
  • In each Entity Inspector in your data model, set Codegen to Category/Extension.
  • In the Project Navigator, delete and trash any Foo+CoreDataClass.m or .swift files, and, to reduce future confusion, rename any Foo+CoreDataProperties.m or .swift files to maybe just Foo.m or .swift.
  • Ensure that each Foo.m or .swift file contains the class definition, to which you can add your own non-managed properties.

(Acknowledgments to the answer by Positron. My answer here explains why Positron's answer (my Solution 1) works, and adds Solution 2 and Solution 3.)

28
votes

Try this Its Working :

In Xcode, go to File->Project/Workspace settings.

Change the build system to Legacy Build system.

27
votes

I had the same problem, I had a one more helper app in main App and copy this in resource. In my case solved as :-

1) Target -> 2)Build Phases 2) Copy File (n items) 3) Remove Copy File.

The Helper app automatically copied in Xcode 10.0.

enter image description here

22
votes

One option which solved my issue is to changing build system to legacy build system. Please follow the following steps in Xcode 10+.

Here I have written a detailed article on the problem & its solution. Xcode Error: Multiple commands produce

enter image description here

enter image description here

20
votes

None of the solutions proposed here worked for me. This was particularly due to CocoaPods. I was previously using Cocoapods 1.3.1. Simply upgrading to 1.5.3 didn't resolve the issue right away.

The steps I followed were:

  1. Delete Podfile.lock
  2. Delete Pods directory
  3. Delete Derived Data & Clean
  4. Exit Xcode
  5. Update CocoaPods to 1.5.3
  6. Run pod install
  7. Open workspace and build
19
votes

In my case PDFGenerator was producing an info.plist file, I just deleted it.

enter image description here

17
votes

This answer is deprecated - XCode 12 has deprecated the Legacy Build System, it will be removed in a further release

I'm using XCode 11.4 Can't build old project

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

enter image description here

enter image description here

13
votes

Solution 1:
In Xcode, go to File ➼ Project/Workspace settings.
➼ Change the build system to Legacy Build system.

Solution 2 :
Open target ➼ Build phases ➼ Copy Bundle Resources ➼ remove info.plist from there. ➼ you will have to remove the plist from the Extensions too (if any).

Solution 3:
If you use CocoaPods you may want to try deintegrate the pods and install again. Commands:

1) pod deintegrate
2) pod install
12
votes

This issue arose for me after adding a second part of the Fabric suite of SDKs to the app.

What actually happened was that the GoogleUtilies Framework was added twice to the Pods project

Two entries for GoogleUtilities.framework

This would have been fine prior to Xcode 10 but Xcode 10 will complain if a file has two actions against it (in this case a copy action).

It's safe to remove the second framework.

11
votes

Before I begin note that my project utilizes Carthage as a dependency manager.

None of the existing answers here resolved my issue. What did resolve the issue for me was the following.

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.

10
votes

Try all this option anyone of this 3 option will work for you, for sure

Option 1: Remove all files from

Target >> Build Phases >> Compile Sources

Target >> Build Phases >> Copy Bundle Resources

Option 2: Change the build system

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

Option 3: remove and update existing pod

pod cache clean PromisesObjC
pod cache clean PromisesSwift
cd [your_project_dir]
rm -rf Pods/
rm Podfile.lock
pod update

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

So the problem I was having is that I had accidentally included the Info.plist in the project settings -> Build Phases -> Copy Bundle Resources for my target.

10
votes

Steps:

  1. Go to Xcode File
  2. Click to WorkSpace Settings
  3. Build System Select as Legacy Build System
10
votes

Here is another working solution : (If you are using custom Pods)

  • Select "Pods" from sidebar as highlights in screenshot.
  • Click on Build Phase. Expand "Headers" section. There are 3 options Public, Private, Project
  • Expand Public and check there are duplicate files. Remove it. DONE!!

enter image description here

9
votes

I had bunch of Multiple commands produce warnings - not limited to info.plist duplication in one target. Including localized resources and string files, headers etc.

Solution: remove all duplications in target membership.

9
votes

My error was:

duplicate output file

'/Users/home/Library/Developer/Xcode/DerivedData/myAppName-fawptgabysjowicvpeqydjniuovo/Build/Products/Debug-iphoneos/myAppName.app/GoogleMaps.bundle' on task: PhaseScriptExecution [CP] Copy Pods Resources /Users/home/Library/Developer/Xcode/DerivedData/myAppName-fawptgabysjowicvpeqydjniuovo/Build/Intermediates.noindex/myAppName.build/Debug-iphoneos/myAppName.build/Script-32CCC25BF727B592A1784900.sh

I focused on the problem file being GoogleMaps.bundle and the location of that file being in [CP] Copy Pods Resources, and the fact that it specified it’s a duplicate output file (I highlighted them in black above), it's the 4th step below

First create a copy of your project and make sure you first do the following steps on that copy

1- In the project navigator I went to the blue project icon

enter image description here

2- I choose Build phases

enter image description here

3- Under Build Phases I choose [CP] Copy Pods Resources

enter image description here

4- Under [CP] Copy Pods Resources I went to Output Files and underneath there I found the file that ended with GoogleMaps.bundle. I selected it and pressed the minus sign to delete it. Make sure you go to Output Files and NOT Input Files

enter image description here

5- I did a clean shift+cmmd+k and afterwards when I built the project the error was gone

The odd thing was even though the red error went away the yellow warning was still there but it worked :)

8
votes

It's worth noting that this error can be produced after auto generation of CoreData models where the Codegen is not set to Manual/None.

To correct this in Xcode 10 double click on your xcdatamodeId file and select each of your entities and set Codegen to Manual/None under Class in your Data Model Inspector.

7
votes

I had this problem when I had a file with the same name in two different targets. For some reason one of those files I had part of both targets. So basically I had two files. And both of those files belonged to one target.

It makes sense that a target can only have one file name per target, so just unchecking the target member box for the file that wasn't related to the main target fixed the issue.

7
votes

I using Carthage and Xcode 10.

My Solution is -> Project -> Target -> General ->

Remove the Frameworks added with Carthage from "Embedded Binaries"

usualy u have to add a script in Build Phases to strip the architecture for app store.

In Xcode 10 the script seems called always. So it copies the frameworks to the right place and you don't have to add them to the General Tab.

Note: if not set -> in Build Settings -> Search Paths -> Framework Search Paths -> set the path to the Framework u added with Carthage .... eg. "$(PROJECT_DIR)/Carthage/Build/iOS"

7
votes

One of my CocoaPods was oudated and caused the issue. Did an pods update and it worked fine.

I believe it may have been the LivePerson SDK

7
votes
error: Multiple commands produce '/Users/KunshtechNew/Library/Developer/Xcode/DerivedData/chat21-fgjaqebxysmggqfdnetggdbzfqih/Build/Products/Debug-iphonesimulator/Chat21.app/Base.lproj/Chat.strings':
1) Target 'chat21' (project 'chat21') has copy command from '/Users/KunshtechNew/Downloads/chat21-ios-demo-master/TildeskWidget/Chat21Core/Base.lproj/Chat.strings' to '/Users/KunshtechNew/Library/Developer/Xcode/DerivedData/chat21-fgjaqebxysmggqfdnetggdbzfqih/Build/Products/Debug-iphonesimulator/Chat21.app/Base.lproj/Chat.strings'
2) Target 'chat21' (project 'chat21') has copy command from '/Users/KunshtechNew/Downloads/chat21-ios-sdk-master 2/Chat21Core/Base.lproj/Chat.strings' to '/Users/KunshtechNew/Library/Developer/Xcode/DerivedData/chat21-fgjaqebxysmggqfdnetggdbzfqih/Build/Products/Debug-iphonesimulator/Chat21.app/Base.lproj/Chat.strings'

There can be 2 different solutions to get rid of this problem:

Solution 1

As We can see I was getting the same error.. in my case there was an extra copy of the folder Chat21Core in TildeskWidget folder ..This was creating issue.. So one of the possible solutions can also be just read the error entirely and try to find if there is any extra copy referenced from project or not.

Solution 2

Another simple solution I found when I face same type of issue for different project. This time I had to apply different solution.

  • pod deintegrate from the project.
  • Remove the workspace file and pod.lock file from the project folder.
  • Again pod install and try to build the project.

Hope this might work for you..

7
votes

If you are manually making your entity's CoreDataClass and CoreDataProperties, make sure you go to your xcdatamodel and set the Codegen in the inspector tab to "Manual/None". Xcode will automatically create a duplicate class for you if this is set as "Class Definition".