Xcode 10 Error: Multiple commands produce

2019-01-03 20:04发布

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.

30条回答
▲ chillily
2楼-- · 2019-01-03 20:35

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 the Product Module Name.

  1. Click on your Target(s) Xcode is complaining about
  2. Click on Build Settings
  3. Search for Product Module Name
  4. Change the name to something unique

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

查看更多
该账号已被封号
3楼-- · 2019-01-03 20:35

While checking the build log, I noticed a warning:

note: Using new build system
note: Planning build
note: Constructing build description
Build system information
warning: The Copy Bundle Resources build phase contains this target's Info.plist file '/Users/<redacted>/Repositories/Whitesmith/optimize-ios/Carthage/Checkouts/WSStatusBarNotification/Miscellaneous/Info.plist'. (in target 'JDStatusBarNotification')

So, if that's your case then just go to your target:

  1. Build Phases
  2. Copy Bundle Resource
  3. Remove info.plist.
查看更多
我欲成王,谁敢阻挡
4楼-- · 2019-01-03 20:36

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.

查看更多
时光不老,我们不散
5楼-- · 2019-01-03 20:39

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.

查看更多
【Aperson】
6楼-- · 2019-01-03 20:41

Here is another working solution : (If you are using Pods)

  • Select "Pods" from sidebar as highlights in screenshot.
  • Click on Build Phase. Expand "Headers" section. There are 3 options Public, Private, Project
  • Expand Public and check there are duplicate files. Remove it. DONE!!

enter image description here

查看更多
家丑人穷心不美
7楼-- · 2019-01-03 20:42

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:

  1. In Xcode, go to File->Project/Workspace settings.
  2. Change the build system to Legacy Build system.

enter image description here 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!

查看更多
登录 后发表回答