8

I get the errors:

Warning: Multiple build commands for output file /Users/me/Library/Developer/Xcode/DerivedData/myapp-csoyvdzaugzkszeagjrtzrfssudr/Build/Products/Debug-iphonesimulator/myapp.app/icon-72.png
Warning: Multiple build commands for output file /Users/me/Library/Developer/Xcode/DerivedData/myapp-csoyvdzaugzkszeagjrtzrfssudr/Build/Products/Debug-iphonesimulator/myapp.app/Default-Landscape@2x~ipad.png
Warning: Multiple build commands for output file /Users/me/Library/Developer/Xcode/DerivedData/myapp-csoyvdzaugzkszeagjrtzrfssudr/Build/Products/Debug-iphonesimulator/myapp.app/Default-Landscape~ipad.png

When I try to run my app in the simulator. I understand this is because of duplicate files. But when I remove either of the duplicates I get the errors:

error: /Users/me/Documents/Cordova27/myapp/myapp/Resources/icons/icon-72.png: No such file or directory

Does anyone know how to fix this at all? Have tried cleaning and restarting XCode to no avail.

MeltingDog
  • 14,310
  • 43
  • 165
  • 295
  • possible duplicate of [Xcode warning: "Multiple build commands for output file"](http://stackoverflow.com/questions/2718246/xcode-warning-multiple-build-commands-for-output-file) – Shantanu Aug 24 '15 at 11:07

6 Answers6

15

open the Copy Bundle Resources Build Phase. find the twice files in that list and Delete the duplicate reference.

MackC
  • 352
  • 3
  • 17
9

Remove both,Add again.[Drag and drop at the icon field in the summary page]

Lithu T.V
  • 19,955
  • 12
  • 56
  • 101
9

I moved bunch of images to a different folders and hit the same issue. To solve, basically go to build phases >> Copy Bundle Resources and remove earlier references as shown in the picture below. Note: Another thing to check is to see if you have multiple references of the files in the left panel (you will see 2 files with the same name)

enter image description here

Raja Rao
  • 5,691
  • 2
  • 28
  • 31
1

If you set the splash/launch icon from Xcode (Targets -> Summary ...), the Xcode has an annoying feature that will copy your png file into the root folder, and after that you will get the warning for "Multiple build commands". What you need to do is, delete your png file used for splash/launch and also check the copy bundle resources in Target section and make sure your file has been removed from there. It will appear in red if the file is removed from your project and not removed from Copy bundle resources.

Alexander Abakumov
  • 13,617
  • 16
  • 88
  • 129
danypata
  • 9,895
  • 1
  • 31
  • 44
1

My problem was also in Copy Bundle Resources, but my cause was fast lane. All of my fastlane files name.txt, keywords.txt, marketing.txt, etc. were copied from each of my support languages into the bundle.

Go to your target Build Settings. In the search tool, enter the name of each fastlane file. In this case, you can delete all fastlane files. These are used for uploading your bundle to the App Store and so the files don't need to be in the bundle at all.

Dan Loughney
  • 4,647
  • 3
  • 25
  • 40
0

Add a new image(PNG) only via Copy Bundle Resources. Remove duplicates same way.

build phases >> Copy Bundle Resources

dip
  • 129
  • 1
  • 4