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条回答
beautiful°
2楼-- · 2019-01-03 20:51

Go to Xcode -> File ->Workspace Settings. You will find one pop up like.

enter image description here

Select "Legacy Build System" from Build System tag. Press on "Done"

Note:- Make sure clear your project with "cmd+shift+alt+k" and "Derived Data"

Build your project it will work charm :)

查看更多
甜甜的少女心
3楼-- · 2019-01-03 20:52

Moving to Xcode 10, errors like

error: Multiple commands produce '/Users/uesr/Library/Developer/Xcode/DerivedData/OptimalLive-fxatvygbofczeyhjsawtebkimvwx/Build/Products/Debug-iphoneos/OptimalLive.app/Info.plist':

can be solved as follows:

Go to Xcode->File->Workspace/Project Settings-> Build System -> Legacy Build System.

查看更多
爷、活的狠高调
4楼-- · 2019-01-03 20:53

I had the same issue with a plist. Turns out I had two copies of it, one was empty and one was in my localized resources folder. Removing one of them (the empty one) solved the issue.

If you check your error, lines 1) and 2) have different paths. You likely have this file defined twice in your copy phase.

Check your target properties, Build Phases, Copy Bundle Resources, and look for a duplicate info.plist. Figure out which path is incorrect and remove it. (You'll probably want to delete it from the filesystem also.)

查看更多
来,给爷笑一个
5楼-- · 2019-01-03 20:53

My issue was in Xcode 10 being run in Mojave, and while trying to run unit tests that I wrote before updating to XCode 10.

In my case, I had this issue while running my "TestTarget" target. To resolve, I had to delete one of the target dependency (in TestTarget > build phases > Target Dependencies) since I had two other targets besides my "TestTarget" and both were running the same script and creating/copying files at a certain point.

And that conflicted with what was mentioned in Build System Release Notes for Xcode 10 here:

It is an error for any individual file in the build to be produced by more than one build command. For example, if two targets each declare the same output file from a shell script phase, factor out the declaration of the output file into a single target.

查看更多
何必那么认真
6楼-- · 2019-01-03 20:54

None of the solutions proposed here worked for me. This was particularly due to CocoaPods. I was previously using Cocoapods 1.3.1. Simply upgrading to 1.5.3 didn't resolve the issue right away.

The steps I followed were:

  1. Delete Podfile.lock
  2. Delete Pods directory
  3. Delete Derived Data & Clean
  4. Exit Xcode
  5. Update CocoaPods to 1.5.3
  6. Run pod install
  7. Open workspace and build
查看更多
虎瘦雄心在
7楼-- · 2019-01-03 20:54

In my case an Info.plist file was scooped up from one of my Cocoapods. Deleted it and solved the problem.

查看更多
登录 后发表回答