Sunday, June 3, 2012

Xcode strange 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 the xcode and i dont see any duplicates of such files at all.



As the apple lists says : http://lists.apple.com/archives/xcode-users/2006/Dec/msg00276.html



there are no duplicates.



Please help.


Source: Tips4all

11 comments:

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

    ReplyDelete
  2. Go to the target you are building and 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.

    ReplyDelete
  3. Actually The answer to this is very simple.

    In your xcode search for the files which raises the warning, and just delete it.

    The Xcode will show only one reference of that file in the search results, but dont stop there, go ahead and delete it. (better make a back up to your project file before delete operation)

    Now do a build, you will see the warning removed.
    (this answer is for a previous version of xcode)

    ReplyDelete
  4. This is not an XCode Bug. Though the warning message is not helpful enough to describe the real cause.

    This error message shows when you have several files in your project that has the same name. you just have to delete one of those and problem is solved.

    ReplyDelete
  5. 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.

    ReplyDelete
  6. 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.

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

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

    ReplyDelete
  9. 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..

    ReplyDelete
  10. This is not a bug. Xcode assists You. Click on "Validate settings". Xcode will check the settings and removes duplicates if possible.

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

    ReplyDelete