"Duplicate output file"/"Unable to build node" for localized folders

We have some HTML content embedded in our app. These live in two top-level folders. These folders have been localized, and so live in

Resources/en.lproj/HelpContent
and
Resources/fr.lproj/HelpContent
(for example). Similarly, we have a bunch of localized .storyboard files.


Xcode 8 builds this just fine. Xcode 9b6 complains:


duplicate output file
'/Users/me/Library/Developer/Xcode/DerivedData/MyApp-
fdskkibuvbsubudkmqtgsjxmyqme/Build/Products/Debug-iphoneos/MyApp.app/
HelpContent' on task: CpResource
/Users/me/Projects/Clients/MyCompany/repo/mp_vision/iOS/Controller/MyApp
/Resources/fr.lproj/HelpContent
/Users/me/Library/Developer/Xcode/DerivedData/MyApp-
fdskkibuvbsubudkmqtgsjxmyqme/Build/Products/Debug-iphoneos/MyApp.app/
HelpContent (in target 'MyApp')



unable to build node:
'/Users/me/Library/Developer/Xcode/DerivedData/MyApp-
fdskkibuvbsubudkmqtgsjxmyqme/Build/Products/Debug-iphoneos/MyApp.app/
HelpContent' (node is produced by multiple commands; e.g.,
'b1132708c20f997e752faabcee01d49c82a500833121dcd848c3954357d9f7b1:
CpResource
/Users/me/Projects/Clients/MyCompany/repo/mp_vision/iOS/Controller/MyApp
/Resources/en.lproj/HelpContent
/Users/me/Library/Developer/Xcode/DerivedData/MyApp-
fdskkibuvbsubudkmqtgsjxmyqme/Build/Products/Debug-iphoneos/MyApp.app/
HelpContent' and
'b1132708c20f997e752faabcee01d49c82a500833121dcd848c3954357d9f7b1:
CpResource
/Users/me/Projects/Clients/MyCompany/repo/mp_vision/iOS/Controller/MyApp
/Resources/fr.lproj/HelpContent
/Users/me/Library/Developer/Xcode/DerivedData/MyApp-
fdskkibuvbsubudkmqtgsjxmyqme/Build/Products/Debug-iphoneos/MyApp.app/
HelpContent')


The Files & Groups list shows it correctly (e.g. "HelpContent" with "HelpContent (English)" and "HelpContent (French)" as sub-folders. The folders only show up once in the Copy Bundle Resources phase.


But the build stops almost immediately on this error.

  • I am experiencing similar issue with xcode 12.4. I am working with a large project with many "version.h" files for example that I am not at liberty to change the names. The project was cleaned before building. What can I do to get it to work? Thank you.

    Build system information error: Multiple commands produce '/Users/..../build/Distribution-iphonesimulator/usr/local/include/Version.h':

    Target 'vncviewersdk' (project 'vncviewersdk') has copy command from '/Users/..../common/libs/plat/Version.h' to '/Users/..../build/Distribution-iphonesimulator/usr/local/include/Version.h'Target 'vncviewersdk' (project 'vncviewersdk') has copy command from '/Users/..../native/common/Version.h' to '/Users/.../build/Distribution-iphonesimulator/usr/local/include/Version.h'
Add a Comment

Replies

Were you able to find a solution to this? I have exactly the same issue when using the new build system (i.e. a localized HTML file that is copied into the Resources directory).

Did you try a clean build folder (option clean) ?

Yes.

Clean build folder is the only clean option for the new build system. I even tried deleting the whole DerivedData folder.

Same problem with some PDF files.


It looks like the resource is being copied directly to the root folder instead of the <lang>.lproj subfolder.


Any solutions?

Same problem for me. Does anyone have a solution?

Sorry about that.


This is a known issue with some projects when using the new build system. For now, you should resolve this by switching back to the old build settings in your Project/Workspace Settings. We will note in the release notes when this problem has been resolved.


- Daniel

So for those watching there is now an Xcode 9.1 beta 2 which, according to the release notes, has the issue resolved

I actually have the same problem with Xcode 9.2.

Is the problem still unresolved?

I just ran into same problem as well trying to use new build system in 9.2. I've got 3 warnings


One warning "cannot link framework foundation.framework."

Two warnings for "duplicate output file" for a .plist and a .strings

Two errors: "unable to build node" for the same .plist and .strings files, both saying "[node is produced by multiple commands]".


I checked build phases and there aren't any duplicate files. But there are three .strings files with the same name, obviously in different paths.


The plist files don't have the same name, but there are two that have names ending in "info.plist".


Builds like a champ in old build system.

One commong cause for this issue is having multiple files in your resources folder that have the same name. In big projects with many nested folders it is quite easy for this to occur. Double check any recent images you have added for example. The build warnings should also indicate a file name somewhere in them as a helpful hint.

This fixed it for me on Xcode 11.0 beta 6.