Xcode: "Warning: multiple build commands for the output file", but I get an error if I delete the duplicate

I get 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 application in a simulator. I understand that this is due to duplicate files. But when I delete one of the duplicates, I get 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? We tried to clear and restart Xcode to no avail.

+8
ios xcode
source share
6 answers

Remove both options, add again. [Drag to the icon box on the summary page]

+9
source share

open the build phase of Copy Bundle Resources . Find twice in this list and delete the duplicate link.

+15
source share

I moved a bunch of images to different folders and got into the same problem. To solve, basically go to the build phases -> Copy the Bundle resources and delete the previous links, as shown in the figure below. Note. Another thing to check is to see if you have multiple file links in the left pane (you will see 2 files with the same name)

enter image description here

+9
source share

If you installed the splash / launch icon from Xcode (Targets β†’ Summary ...), Xcode has an annoying function that will copy your png file to the root folder, after which you will get a warning for "Several build commands." What you need to do is delete your png file used for splash / launch, and also check the copy bundle resources section in Target and make sure your file is deleted. It will be red if the file is deleted from your project and not deleted from copy bundle resources .

+1
source share

Add a new image (PNG) only through the Bundle copy resources. Remove duplicates in the same way.

build phases>> "Copy Bundle Resources

0
source share

My problem was also in the Bundle Copy Resources, but my reason was a quick streak. All my files are fastlane name.txt, keywords.txt, marketing.txt, etc. They were copied from each of my support languages ​​into a package.

Go to build settings. In the search tool, enter the name of each fastlane file. In this case, you can delete all Fastlane files. They are used to upload your package to the App Store, so the files do not have to be included.

0
source share

All Articles