Duplicate output file

Hi everyone.


Multiple commands produce '/Users/username/Library/Developer/Xcode/DerivedData/myApp-cqsvatsweajrlwgztrbdqodhawmh/Build/Products/Debug-iphonesimulator/myApp.app/Info.plist':

1) Target 'myApp' (project 'myApp') has copy command from '/Users/username/Documents/Custom-Projects/aFolder/myApp/myApp/Info.plist' to '/Users/username/Library/Developer/Xcode/DerivedData/myApp-cqsvatsweajrlwgztrbdqodhawmh/Build/Products/Debug-iphonesimulator/myApp.app/Info.plist'

2) Target 'myApp' (project 'myApp') has process command with output '/Users/username/Library/Developer/Xcode/DerivedData/myApp-cqsvatsweajrlwgztrbdqodhawmh/Build/Products/Debug-iphonesimulator/myApp.app/Info.plist'

I think I did something wrong somewhere but I don't know where.

I have a project with two targets, the difference between both are the name of the app and, of course, the info.plist.

Both targets compile fine till yesterday afternoon, one target compile fine but the other not with the following message:


I work with Xcode 11.x.x and with the new build system (not the legacy) and that for a long time.

I checked everything I can and finally, I restaured a copy of my app from TimeMachine but the probleme stay.

When I try to compile, the following error message appear immediately:


Showing Recent Messages

Build target MyApp of project MyApp with configuration Debug

warning: The Copy Bundle Resources build phase contains this target's Info.plist file '/Users/theDev/Documents/Custom-Projects/MyFolder/MyApp/MyApp/Info.plist'. (in target 'MyApp' from project 'MyApp')


warning: duplicate output file '/Users/theDev/Library/Developer/Xcode/DerivedData/MyApp-cqsvatsweajrlwgztrbdqodhawmh/Build/Products/Debug-iphonesimulator/MyApp.app/Info.plist' on task: ProcessInfoPlistFile /Users/theDev/Library/Developer/Xcode/DerivedData/MyApp-cqsvatsweajrlwgztrbdqodhawmh/Build/Products/Debug-iphonesimulator/MyApp.app/Info.plist /Users/theDev/Documents/Custom-Projects/GOKYO/MyApp/MyApp/Info.plist (in target 'MyApp' from project 'MyApp')

So I think it's not in my app but somewhere on my MacBook Pro ?

I would appreciatye if someone could help.

Thanks

I answer to myself.

The error comes from using the automatic increment script of the Bundle version below. It copies the info.plist to the project.bundlePhase files, which creates a duplicate.

Here is the script:


#!/bin/bash
bN=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "$INFOPLIST_FILE")
bN=$((bN += 1))
bN=$(printf "%d" $bN)
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $bN" "$INFOPLIST_FILE"


This script is from Jeffrey Jackson at CoderWall.com

Note: this script run correctly with a new app created with the New Build System, not with older one. (It's my case)

HTH

After a lot of looking around this worked for me, I had to change this setting.
Goto Project Target > Build Phases > Embed Pods Framework > check the option "for install builds only" under Run script:
hi
I'm a noob on ios development.
I develop my first app (webview app) and the first build works fine, with only a minor bug.
I tried to fix it but the building process failed with the same errors that you have.
I decided to roll back the changes but the errors didn't disappear.
Can you help me to fix the problem?
Any advice is wellcome
I use Xcode 12.3

you have 2 info.plist files on your project remove one

This could be due to a number of things. My problem was similar to Chrisp101. I had added 2 InfoPlist.strings files and added them both to both targets instead of one to one and one to the other. Once I made sure each file had only one target checked I was able to build again.

Duplicate output file
 
 
Q