[xcode] Xcode warning: "Multiple build commands for output file"

I am getting an error like this:

[WARN]Warning: Multiple build commands for output file /Developer/B/Be/build/Release-iphonesimulator/BB.app/no.png

[WARN]Warning: Multiple build commands for output file /Developer/B/Be/build/Release-iphonesimulator/BB.app/d.png

[WARN]Warning: Multiple build commands for output file /Developer/B/Be/build/Release-iphonesimulator/BB.app/n.png

But I have checked Xcode and I don't see any duplicates of such files at all. As this post in the Apple Mailing Lists say, there are no duplicates.

This question is related to xcode build warnings

The answer is


This is easily caused when you add git based subprojects. Xcode isn't smart enough to ignore the .git subfolder even though you can't see it from finder, so it will get very confused that there are multiple files named "master" or "exclude", (standard git repo files). With Xcode4, go to the project (root of the left tree) then click your app target and expand "Copy Bundle Resources", then remove all the references to .git, you shouldn't need them baked into your app anyway.


The error seem to appear when u have more than one reference of the same file. I had 2 files of the same name and got this error. When I delete one of them the error disappear..


another version of this situation can occur when there are duplicates in the Headers build phase.

to fix this …

  1. go to your project target
  2. choose Build Phases
  3. choose the Headers build phase
  4. enter the name shown in the warning
  5. notice the two (or more) items
  6. find the +|- boxes in the lower left corner
  7. select one of the items, and click the - button

Open the Frameworks folder in your project and make sure there are only frameworks inside. I added by mistake the whole Developer folder!


React-Native users. goto file -> workspace settings -> build system -> change it to legacy build system. and it should build fine now. React-Native isn't compatible with the new file system yet.


As previously mentioned, this issue can be seen if you have multiple files with the same name, but in different groups (yellow folders) in the project navigator. In my case, this was intentional as I had multiple subdirectories each with a "preview.jpg" that I wanted copying to the app bundle:

group references

In this situation, you need to ensure that Xcode recognises the directory reference (blue folder icon), not just the groups.

Remove the offending files and choose "Remove Reference" (so we don't delete them entirely):

remove group references


Re-add them to the project by dragging them back into the project navigator. In the dialog that appears, choose "Create folder references for any added folders":

add as folder references


Notice that the files now have a blue folder icon in the project navigator:

folder references


If you now look under the "Copy Bundle Resources" section of the target's build phases, you will notice that there is a single entry for the entire folder, rather than entries for each item contained within the directory. The compiler will not complain about multiple build commands for those files.


I'm pretty sure this can be caused by an XCode 4 bug, at least in the cases that I've encountered it in.

It happens if you add multiple language dependent files to the project at the same time. I found this out by looking through the git differences. I did nothing in the commit but add some new localized nib files. But looking back at the difference of the project.pbxproj file it showed a bunch of new duplicate references added for files that were already in the project before. The files it did this too seemed random to me.

I reproduced this same exact behavior multiple times.

Deleting these files from the project does not fix the problem because it only deletes the original reference and leaves the duplicates. The only way to fix it is to go back a commit and start over, or hand edit the project file, which is a really good way to screw it up even more since it's hard to tell which duplicates to remove and you have to do it in a ton of different places.

Xcode 4 is just a huge disappointment for me.


I had the same problem minutes ago. I've mentioned changing the 'deployment target' fixed my problem.


This is not an Xcode bug, though the warning message is not helpful enough to describe the real cause.

This error message occurs when you have several files in your project that have the same name. You just have to delete or rename the files with duplicate names and the problem is solved.


For me the Target > Build Settings > Packaging > Product Name was set to the same thing as another value referenced in a .plist file which was custom to my app. Eventually due to our build process this creates duplicate files.


Yet another variation on this issue. I had the same message come up none of the previously suggested solutions solved the problem (I definitely only had one copy of the offending file for instance).

My solution was to edit the project.pbxproj file in a text editor (after quitting XCode and backing up the file of course) and remove all references to the offending file. Then, after starting XCode again, I manually added the file back into the project and everything was ok.

(My suspicion is that this problem happened to me because of a manual, ie: non-XCode, merge of the project file.)


Swift 3: (but also the older versions) it happen when I have assets with duplicates. Just rename the files with this issue and all go well.

It could happen also when you have made a Assets.xcassets and you have renamed the duplicates with new names so after time you forgot it and remove it to add the folder references but this one return to the duplicate files problem..


One of simple way is,

  • Go to App target
  • Go to Build Phases
  • Output files
  • Delete path of out put files, then build project. It will run successfully.

This happends because ur "no.png" "d.png" and "n.png" are duplicated in resources . Just look for delete dublicated files and delete.


While I'm sure there is a better way, nuking only took me less than 60 seconds, and was the only thing I could find that worked.

  1. Drag repo to the trash.
  2. re-clone your repo.
  3. set up your repo with correct remote tracking. git remote add <url.git>, or git remote set-url <url.git>

In my case the issue was caused by the same name of target and folder inside a group.

Just rename conflicted file or folder to resolve the issue.


In the Project Navigator, select your Xcode Project file. This will show you the project settings as well as the targets in the project. Look in the "Copy Bundle Resources" Build Phase. You should find the offending files in that list twice. Delete the duplicate reference.

Xcode is complaining that you are trying to bundle the same file with your application two times.


Commenting use_frameworks! in PodFile worked for me.

#use_frameworks!

Note: Did this on XCode 10.1, pod version 1.8.4


This happens if you have 2 files with the same name in the project. Even though files are in groups in XCode when the project is compiled all of the files end up in the same directory. In other words if you have /group1/image.jpg and /group2/image.jpg the compiled project will only have one of the two image.jpg files.


The key was to do pod deintegrate and rm *.workspace file ! What a waste of time !


I found a pretty easy solution for this:

  1. Select the file causing the problem from the project navigator
  2. Uncheck the target membership from the file inspector
  3. Build the project
  4. Recheck the target membership for the file again

The warning is gone! Check this image for reference.

enter image description here


This is not a bug. Xcode assists can assist you. Select the target, to the left in the project Navigator. Click on "Validate settings" at the bottom of the settings. Xcode will check the settings and removes duplicates if possible.


Examples related to xcode

Undefined Symbols error when integrating Apptentive iOS SDK via Cocoapods Xcode 12, building for iOS Simulator, but linking in object file built for iOS, for architecture arm64 iPhone is not available. Please reconnect the device Make a VStack fill the width of the screen in SwiftUI error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65 The iOS Simulator deployment targets is set to 7.0, but the range of supported deployment target version for this platform is 8.0 to 12.1 Xcode 10.2.1 Command PhaseScriptExecution failed with a nonzero exit code Git is not working after macOS Update (xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools) Xcode 10: A valid provisioning profile for this executable was not found Xcode 10, Command CodeSign failed with a nonzero exit code

Examples related to build

error: This is probably not a problem with npm. There is likely additional logging output above Module not found: Error: Can't resolve 'core-js/es6' WARNING in budgets, maximum exceeded for initial How can I change the app display name build with Flutter? Error - Android resource linking failed (AAPT2 27.0.3 Daemon #0) Still getting warning : Configuration 'compile' is obsolete and has been replaced with 'implementation' Could not find com.android.tools.build:gradle:3.0.0-alpha1 in circle ci Error:Execution failed for task ':app:compileDebugKotlin'. > Compilation error. See log for more details Component is part of the declaration of 2 modules Maven build Compilation error : Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project Maven

Examples related to warnings

numpy division with RuntimeWarning: invalid value encountered in double_scalars libpng warning: iCCP: known incorrect sRGB profile How to use _CRT_SECURE_NO_WARNINGS C pointers and arrays: [Warning] assignment makes pointer from integer without a cast Server configuration by allow_url_fopen=0 in IntelliJ IDEA shows errors when using Spring's @Autowired annotation Warning :-Presenting view controllers on detached view controllers is discouraged Data truncated for column? Warning message: In `...` : invalid factor level, NA generated How to suppress warnings globally in an R Script