1033

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 Xcode 9 works, but there is an error in Xcode 10.

6
  • For cocoapods managed dependencies, refer to stackoverflow.com/a/52421345/334999
    – Shuo
    Sep 20, 2018 at 9:04
  • 11
    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 phases
    – protspace
    Oct 30, 2018 at 9:29
  • 120
    Dear reader, read EVERY answer to this question, there are many different things that may be wrong.
    – iluvcapra
    Jun 20, 2019 at 22:52
  • Goto path "Build Phases->Copy Bundle Resources". Check for file name and delete the same. Clean and run the apllication Feb 13, 2020 at 8:54
  • 2
    I concur with @iluvcapra. Keep reading and trying the different solutions in this thread. They all work! But only for the right situation. Thank you brother Capra lover. You inspired me to stick with this thread over the course of a couple few days and finally, after trying and eliminating many different possibilities, I DID find the solution, IN THIS THREAD!, toward its certainly ever extending tail, miraculously. IMHO opinion: This error message: error: Multiple commands produce <filename>, is waaaaaay to general. Apple must disambiguate this at some point surly? Jan 20, 2022 at 5:24

101 Answers 101

1964

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.

39
  • 14
    You may also need to look in any dependencies ie CocoaPods for wrongly added info.plist files Jun 6, 2018 at 16:50
  • 85
    To elaborate a bit: This error is happening because Xcode 10's new build system is better at catching project configuration issues. Issues like these can sometimes cause subtle problems with your build, so it's good to fix them. Jun 6, 2018 at 17:39
  • 11
    In my case, I had an info.plist file in one of my private CocoaPods dependencies that was getting scooped up because it was matched by the podspec's source_files property. I didn't need the info.plist file in my module, so I just deleted it.
    – aapierce
    Sep 17, 2018 at 16:38
  • 4
    Thanks! I had added some developers plugin n my code some time ago and it also had an info.plist file which conflicted with my app's info.plist Oct 5, 2018 at 6:32
  • 3
    Thank you @Alok :) Instead of removing the files, I renamed both of them with unique names and my code is working all fine.
    – kinza
    Dec 31, 2018 at 10:03
612

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

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.

15
  • 6
    can you explain why is this issue coming and also how choosing Legacy Build System resolves it? @Akshay Sunderwani
    – user832
    Sep 20, 2018 at 10:22
  • 275
    You are not fixing the issue, you are just hiding them.
    – Caio
    Sep 20, 2018 at 17:33
  • 4
    Fixes build error for react-native projects. See issue here: github.com/facebook/react-native/issues/20492 There is a possible fix if you don't want to switch to the Legacy Build System: github.com/facebook/react-native/issues/…
    – Eugen Timm
    Oct 12, 2018 at 11:52
  • 10
    This is not a long-term fix. Eventually the legacy build system will no longer be an option.
    – Paul King
    Oct 15, 2018 at 22:38
  • 8
    Well I'm 100% gonna hide the problem instead of fixing it because none of these solutions work. Seems to be a known problem with Cocoapods; see github.com/CocoaPods/CocoaPods/issues/7949 . I'll hope it somehow fixes itself by the time this workaround is no longer an option.
    – sudo
    Jan 9, 2019 at 6:50
172

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

7
  • As per my understanding our existing projects are made in old swift and xcode which are supported old version of swift and xcode. So earlier what we did, we went on "Bundle Settings->Swift legacy Build System"and did select earlier version. Sep 24, 2018 at 6:48
  • I originally had it on "Swift Legacy Build System", but it had been switched after restarting my computer. Even if you think you have this set correctly, it could still be worth double-checking. Sep 26, 2018 at 17:17
  • 45
    This solution do not fixing the issue, it just hiding it.
    – Argus
    Nov 26, 2018 at 16:38
  • Also make sure you change the Per-User workspace settings to the same ;)
    – Wei Shen
    Feb 19, 2019 at 7:04
  • 3
    Legacy Build System is now officially depreciated, as of Xcode 12: "The legacy build system is deprecated, and will be removed in a future release. (62742902)" (developer.apple.com/documentation/xcode-release-notes/…)
    – u2Fan
    Sep 23, 2020 at 13:44
164

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".

9
  • 90
    The xcdatamodeld file should actually be in Compile Sources. if you're seeing this error in relation to Core Data it's likely because you invoked "Create NSManagedObject Subclass" but you have your Entity set to Codegen = "Class Definition". This means it's automatically creating these classes for you and you created them manually so they exist twice.
    – William T.
    Apr 8, 2019 at 20:25
  • 1
    @WilliamT. So what should be the value of Codegen if one is invoking Create NSManaged Object Subclass?
    – Kaunteya
    Jul 21, 2019 at 13:01
  • 5
    @Kaunteya There's an option to set the Codegen to "Manual" on each CoreData Attribute (table)
    – William T.
    Jul 21, 2019 at 21:35
  • 3
    Follow @WilliamT. advice and then clean and build.
    – PruitIgoe
    Oct 25, 2019 at 20:05
  • 1
    @WilliamT. is right (great thanks!) for those who experimented with Core Data. In the Navigator Area on the left of XCode, find and click your .xcdatamodeld file > in the Editor Area in the middle of XCode, select your Entity > its attributes will be displayed on the far right > find Codegen and change its value from "Class Definition" to "Manual/None". That's it.
    – Meo Flute
    Dec 8, 2019 at 12:18
112

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

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

5
  • 56
    In this case Xcode is flagging a problem in the project, so reverting to the legacy build system will just hide it for now. Xcode's reporting of these sorts of problems is intentional and it's best to fix the issue. Jun 6, 2018 at 17:36
  • 2
    If the error is in CocoaPods' generated project then I would disable the new Build System until a new CocoaPods version fixes the problem.
    – E. Rivera
    Jul 18, 2018 at 8:20
  • @RickBallard makes sense, now, which could be the right fix? there seems to be a mix of answers
    – Rolando
    Oct 9, 2018 at 9:24
  • 1
    There are multiple causes of this kind of error, but you can read more about what it means at help.apple.com/xcode/mac/10.0/#/dev14a2fd0c0 Oct 22, 2018 at 17:38
  • Legacy Build System is now officially depreciated, as of Xcode 12: "The legacy build system is deprecated, and will be removed in a future release. (62742902)" (developer.apple.com/documentation/xcode-release-notes/…)
    – u2Fan
    Sep 23, 2020 at 13:44
81

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

13
  • 1
    It worked a bit fine, but then it broke with the bridging file. Sep 16, 2018 at 21:23
  • 5
    In my case, I had to select All on the right of where you search for Product Module Name to make that build configuration show.
    – Hodson
    Sep 20, 2018 at 12:12
  • 58
    I got same problem in Xcode 10. Same project was working fine in Xcode 9.4.1. So the solution is very simple. Just remove all info.plist files from target. Please do this for all info.plist files. Step:1. Select info.plist file. 2. In File inspector Untick the project in Target Membership. Then run your project. Thanks !
    – An Kit
    Sep 24, 2018 at 17:33
  • 14
    For me I had to go to the [Project_Name] > Build Phases > Copy Bundle Resources and remove the duplications there Sep 25, 2018 at 8:37
  • 5
    @Bharath Don't remove info.plist files from your project. You need to remove only from Target as I mentioned. We can't remove info.plist, It's very important for project.
    – An Kit
    Oct 9, 2018 at 4:36
55

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

pod deintegrate

pod install

3
  • Yes, my problem was caused by a pod package and only this fixed the problem! thanks
    – CodeBrew
    Jun 2, 2019 at 20:51
  • 1
    Yeah! This happened to me after playing around with Pods and adding App icon through XCode bit later on. Hope this helps
    – Jan Sila
    Nov 16, 2020 at 10:56
  • Did not work work me. Nov 14, 2022 at 14:37
52

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.
3
  • 47
    info.plist file is not present in copy bundle resources, still getting the same error Jul 15, 2018 at 16:03
  • Removing an excessive Info.plist from the copy bundle resources build phase solved it for me. However, my warning was different because accidentally an Info.plist of a different target but within the same project was added to the Copy Bundle Resources build phase. The warning was: "warning: duplicate output file '... MyApp.app/Info.plist' on task: ProcessInfoPlistFile". And leading to the same error as in the original question: "error: Multiple commands produce '... MyApp.app/Info.plist'". Sep 26, 2018 at 12:40
  • in my case it was "LICENSE" file - once I've removed it, the issue was fixed, so I guess the problem is more general than "plist", just seems to be just a more often encountered
    – vir us
    Feb 6, 2019 at 17:41
45

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

1
  • 1
    Nice answer. Just wanted to add you can clear the duplicated hidden files using 'Product > Clean Build Folder' after fixing the Codegen to Manual/None taken from a comment from here. Nov 8, 2019 at 3:09
41

Solution 1 :
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 2:
If you use CocoaPods you may want to try deintegrate the pods and install again. Commands:

1) pod deintegrate
2) pod install

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

15
  • 1
    I was using different versions of deployment target in my pod file, so I kept the all the target version same., and pod deintegrate and pod install worked for me
    – Chaitu
    Mar 5, 2021 at 16:43
  • 1
    In my case Solution 2 worked. I've added the info.plist file so it got added in bundle resources automatically. After I removed the info.plist from Copy Bundle Resources, issue resolved.
    – Vinoth
    Oct 22, 2021 at 14:09
  • 1
    "Legacy Build System" is deprecated so I use Solution 2 and it worked fine... Nov 8, 2021 at 13:00
  • 1
    Solution 2 worked for me. Thanks Dec 15, 2021 at 5:17
  • 1
    I have Tried Solution 2 and 3 it's working fine for me, Solution 1 is deprecated. For me many duplicated files so tried this one too... Build Phases --> Compile Sources. Check and remove duplication of errored files Dec 31, 2021 at 5:02
34

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

3
  • 5
    Copy files + Copy Bundle Resources deletion helped. Jun 29, 2018 at 17:05
  • This worked for me with slight modification - In my case there were multiple files in the copy files step, somehow the same filenames were copied to the bundle multiple times/twice - resulting in the error : deleting a single row needs you to highlight the row/filter the name complained in the error and delete one row by minus sign (its always on the bottom row) instead of deleting that entire copy files step. Jan 1, 2019 at 0:18
  • This worked for me with different approach i am using Xcode 15.2 version i removed the row called "Embedded Pods Frameworks" Worked :) Feb 20 at 9:28
27

Try this Its Working :

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

Change the build system to Legacy Build system.

1
  • 5
    In this case Xcode is flagging a problem in the project, so reverting to the legacy build system will just hide it for now. Xcode's reporting of these sorts of problems is intentional and it's best to fix the issue. For more information please see help.apple.com/xcode/mac/10.0/#/dev14a2fd0c0. Oct 22, 2018 at 17:39
25

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
5
  • 5
    Updating CocoaPods to 1.5.3 (sudo gem install cocoapods) and running (pod install) was enough to get it working for me. Thanks! Oct 4, 2018 at 17:47
  • I did some of recommened above but this was the only one that solved for me. Thanks
    – Almeida
    Nov 4, 2018 at 21:59
  • This one solved it for me too. I think it is better than the legacy build solution because it actually takes care of the issue.
    – MateusK
    Jun 25, 2019 at 14:13
  • 1
    This worked for me, but I also had to add install! 'cocoapods', :disable_input_output_paths => true at the top of my podfile. Additionally, if you don't want to update your pods - don't delete podfile.lock and all pods will be installed at their current version.
    – DoesData
    Jul 21, 2019 at 21:28
  • This is a great general process for fixing lots of things. Great answer.
    – Iskeraet
    Jul 7, 2021 at 16:53
23

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

1
  • 2
    This answer has single-handedly fixed like 12 problems I have been having in Xcode with React Native. Thank you! Sep 2, 2019 at 22:11
20

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

enter image description here

0
19

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

0
16

there are some reasons that cause this error to be shown.

1- the project name is the same as a dependency that is used on the project

this error may happen when you choose a name for your project that is the same as one of the dependencies that you use on the project for example you cannot choose FirebaseAuth or GoogleSignIn as the project's name if you use them via pod or SPM.

to solve this problem you should change the project name with the following way:

choose the project from project navigator on the left sidebar, change the project name from the file inspector -> Identity and Type -> name from the right sidebar.

enter image description here

after you change it, XCode asks you to change all relative targets and just press rename.

enter image description here

2 - duplicated info.plist on the Copy Bundle resources portion

you may face this error when info.plist is added to Copy Bundle resources unwanted, choose project form project navigator -> choose target -> goto Build Phases tab -> Copy Bundle Resources and if you see info.plist there, remove it by choose info.plist like the following image

enter image description here

3 - pod files do not work well

sometimes you got this error because the dependencies that you use break for unexpected reasons.

1 - Delete Podfile.lock

2 - Delete Pods directory

3 - Delete Derived Data & Clean (you can find this directory from XCode menu -> Preferences... -> Locations -> Derived Data and go to the directory by clicking the arrow icon at the right of the address)

4 - Exit Xcode

5 - Update CocoaPods with [sudo] gem install cocoapods on mac terminal

6 - goto the project directory on the terminal and run pod install

7 - Open workspace and build

5- duplicated Core data

you may face this problem when you use Core data on the project

first I explain coreData codegen types:

enter image description here

**Class Definition: ** Choose Class Definition when you don’t need to edit the properties or functionality of the managed object subclass and properties files that Core Data generates for you.

Category/Extension: Choose Category/Extension to add additional convenience methods or business logic inside your managed object subclass.

Manual/None: Choose Manual/None to edit the properties in your managed object subclass, for example, to alter access modifiers, and to add additional convenience methods or business logic.

Choose the Manual/None and check if a copy of xcmodeldata is exist on CopyBundleRecources, remove it.

enter image description here

14

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.

3
  • 1
    I used PODS. Removing everything from Embed Frameworks worked. I clean and rebuilt with no errors. The legacy solution also works but doesn't solve the issue at hand (for anyone reading this). I'm on xcode 10.2, cocoapods-1.6.1. May 9, 2019 at 15:52
  • 1
    I'm using Carthage and this fixed it for me! Dec 26, 2019 at 18:50
  • I also used CocoaPods. Framework is connected as development pod. "Embed Frameworks" is empty and still got this issue
    – Luten
    May 28, 2020 at 12:35
14

Well, in my case:

If you create two file with same name, will trigger this error. Remove the one you recently added, will solve this problem.

Hope this helps.

1
  • Look for duplicates in Project -> Target -> Build Phases. My duplicate was Settings.bundle Apr 28, 2022 at 19:16
13

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.

13

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.

3
  • The same for me, but using Carthage dragging all .frameworks to libraries section project Dec 18, 2019 at 22:29
  • Have you fixed this @Damo Apr 3, 2020 at 15:36
  • I am facing this issue, Could you tell me how to fix this, without changing legacy Apr 3, 2020 at 15:54
13

Unfortunately none of these answers worked for me... here was the error I was seeing:

"Multiple commands produce '/Users/.../.../.../Frameworks/abcdef.framework"

  1. That command depends on command ...: script phase ""
  2. That command depends on command ...: script phase ""

Adding this line to the Podfile and doing a " Pod Install " was the ONLY thing that worked.

install! 'cocoapods', :disable_input_output_paths => true

I really hope this helps someone. I spent hours trying to fix this and finally got it.

Sometimes I just wish Xcode was as efficient as IntelliJ / Android Studio :(

Goodluck!

4
  • note, this one requires newer pod installation > 1.6 i guess based on this ralfebert.de/ios/blog/cocoapods-clean-input-output-files
    – Hofi
    Feb 25, 2021 at 17:49
  • You might want to do first a Product -> Clean Build Folder. Oct 30, 2021 at 12:41
  • OMG Mario! This worked for me! THANK YOU so much for this solution. My problem was specifically with Google Analytics pods creating the error. I just inserted this line near the top of my Podfile and suddenly my project would build. My steps were: 1) Add this line to pod file 2) Pod deintegrate 3) Pod install 4) Product --> Clean Build Folder 5) Build code base 6) Scream hallelujah, hug my girlfriend, pop a cold one, light a fatty and relax 7) :-D Jan 20, 2022 at 5:13
  • @KeithTheBiped Happy to help!! Happy coding :) Mar 2, 2022 at 18:59
11

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

11

This answer for you if you are facing problem in core data. Go to yourfilename.xcdatamodeld and make sure all the entities have manual/None Codegen. enter image description here

10

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.

1
  • This was precisely the solution for me too, as this error occurred while trying to run tflite_camera_example in Xcode 10
    – zai chang
    Oct 3, 2018 at 7:38
10

Go in Project Build Phase and Remove info.plist from the Compile Sources. It will remove that issue and project will be active again.

enter image description here

1
  • 2
    Thanks for the solution. My problem was in copy bundle resources section of the Build phases, I removed info.plist from there and the problem got solved. Dec 16, 2022 at 11:07
10

Steps:

  1. Go to Xcode File
  2. Click to WorkSpace Settings
  3. Build System Select as Legacy Build System
3
  • 7
    In this case Xcode is flagging a problem in the project, so reverting to the legacy build system will just hide it for now. Xcode's reporting of these sorts of problems is intentional and it's best to fix the issue. For more information please see help.apple.com/xcode/mac/10.0/#/dev14a2fd0c0. Oct 22, 2018 at 17:40
  • This works for me. Changing product name doesn't. As my product is mixed with half objective-c code and swift code. My issue is "Multiple commands produce swiftmodule"
    – wzhang84
    Oct 25, 2018 at 21:02
  • there is problem it is showing that Legacy Build System is depratcted Feb 2, 2021 at 11:57
10

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

2
  • this answer should also be seen as a solution in case the (custom) pod is causing the issue!
    – MkaysWork
    Oct 8, 2018 at 13:37
  • Also you can remove any *.plist files from here. It seems to work for custom pods.
    – Amit Ahire
    Mar 13, 2020 at 12:46
10

I am new to IOS development and I tried the above answers but they did not work for me.

My XCode version is 12.4, Swift 5

I was getting Multiple commands produce error while building

I tried to expand the error from the error list but double-clicking it did nothing so first it was difficult for me to know the full error.

So I right clicked the error and copied to clipboard, pasted it in text editor.

It showed the full error

It said which part has the problem

Multiple commands produce '/Users/userName/Library/Developer/Xcode/DerivedData/ProjectName-fbeqffupediuiedlrplqjyhgyqna/Build/Products/Production-iphoneos/XCFrameworkIntermediates/GoogleAppMeasurement':
1) That command depends on command in Target 'GoogleAppMeasurement-iOS12.3' (project 'Pods'): script phase “[CP] Copy XCFrameworks”
2) That command depends on command in Target 'GoogleAppMeasurement-iOS14.1' (project 'Pods'): script phase “[CP] Copy XCFrameworks”

(I am using Google Firebase)

I was surprised to see that the pods were being compiled for 2 different versions of iOS (12.3 and 14.1)

I found that, in the active target configuration, I set iOS 12.3 in the Deployment Info section and set 14.1 in Deployment Target in Project level Info tab

Setting both to same required version and then clean and build solved the issue.

Please let me know if setting 2 different versions is a mistake or not. If it was not a mistake, then what to do keeping following in mind:

  • I am not allowed to set build system to legacy
  • info.plist does not exist in the Copy Bundle Resources phase
1
  • 1
    Copying and pasting the error is a very good tip!!!
    – JCutting8
    Aug 13, 2021 at 13:21
10

In my case I had the error about the Info.plist duplicate output file :

warning: duplicate output file


/Users/mahdifaraji/Desktop/boilerplate/ios/boilerplate.xcodeproj: warning: The Copy Bundle Resources build phase contains this target's Info.plist file '/Users/mahdifaraji/Desktop/boilerplate/ios/boilerplate/Info.plist'. (in target 'boilerplate' from project 'boilerplate')
warning: duplicate output file '/Users/mahdifaraji/Library/Developer/Xcode/DerivedData/boilerplate-fpkyeiljiiuxbidceadasmpsntah/Build/Products/Debug-iphonesimulator/boilerplate.app/Info.plist' on task: ProcessInfoPlistFile /Users/mahdifaraji/Library/Developer/Xcode/DerivedData/boilerplate-fpkyeiljiiuxbidceadasmpsntah/Build/Products/Debug-iphonesimulator/boilerplate.app/Info.plist /Users/mahdifaraji/Desktop/boilerplate/ios/boilerplate/Info.plist (in target 'boilerplate' from project 'boilerplate')

** BUILD FAILED **

I solved the issue by removing it from Project -> Target -> BuildPhases -> Copy Bundle Resources

1
  • Thanks! it works for me, but I don't understand why.
    – pigfly
    Apr 13, 2023 at 8:05

Not the answer you're looking for? Browse other questions tagged or ask your own question.