error: Multiple commands produce '/Users/uesr/Library/Developer/Xcode/DerivedData/OptimalLive-fxatvygbofczeyhjsawtebkimvwx/Build/Products/Debug-iphoneos/OptimalLive.app/Info.plist':
1) Target 'OptimalLive' has copy command from '/Users/uesr/Desktop/workSpace/SEALIVE/SeaLive1.1/OptimalLive/Info.plist' to '/Users/uesr/Library/Developer/Xcode/DerivedData/OptimalLive-fxatvygbofczeyhjsawtebkimvwx/Build/Products/Debug-iphoneos/OptimalLive.app/Info.plist'
2) Target 'OptimalLive' has copy command from '/Users/uesr/Desktop/workSpace/SEALIVE/SeaLive1.1/OptimalLive/Server/Masonry/Info.plist' to '/Users/uesr/Library/Developer/Xcode/DerivedData/OptimalLive-fxatvygbofczeyhjsawtebkimvwx/Build/Products/Debug-iphoneos/OptimalLive.app/Info.plist'
3) Target 'OptimalLive' has process command with input '/Users/uesr/Desktop/workSpace/SEALIVE/SeaLive1.1/OptimalLive/Info.plist'
running the code in Xcode9 works, but results in an error in Xcode10.
If you are getting this from the
Ditto
command creating multiple instances of the same name (NOT the'copy files' build phase
), you may have to change theProduct Module Name
.Build Settings
Product Module Name
We have a watch target and a few notification targets in our app, so I just put things like
Extension
on the end of the module name.I found this solution originally here: https://forums.developer.apple.com/thread/103913
While checking the build log, I noticed a warning:
So, if that's your case then just go to your target:
info.plist
.Had similar issue but with .swiftdoc files.
I have extensions and unit test targets in project. And they had same "Product Module Name" (PRODUCT_MODULE_NAME in Build Settings) as application. After making names unique issue gone.
I had this problem when I had a file with the same name in two different targets. For some reason one of those files I had part of both targets. So basically I had two files. And both of those files belonged to one target.
It makes sense that a target can only have one file name per target, so just unchecking the target member box for the file that wasn't related to the main target fixed the issue.
Here is another working solution : (If you are using Pods)
I found the solution for this build error, for anybody else having the same issue with Xcode 10 build system, follow the following steps to fix it:
It will resolve the build issue with the new Xcode 10.
If you want to work with the new build system, then you can find the troubleshooting help from this apple Xcode help page.
Hope this helps!