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条回答
淡お忘
2楼-- · 2019-01-03 20:43

I was experimenting with Core Data. I built a data model for a simple checklist program and generated the NSManagedObjects. When I compiled the project I got the following error:

error: Multiple commands produce '/Users/myUSerName/Library/Developer/Xcode/DerivedData/myCoreDateExperiment-gzbslaqdwglkzxemijpdqmizgyzc/Build/Intermediates.noindex/ myCoreDateExperiment /Debug-iphonesimulator/ myCoreDateExperiment.build/Objects-normal/x86_64/CheckListItem+CoreDataProperties.o':
1) Target ' myCoreDateExperiment ' (project ' myCoreDateExperiment ') has compile command for Swift source files
2) Target ' myCoreDateExperiment ' (project ' myCoreDateExperiment ') has compile command for Swift source files

The problem was the data model (CheckList.xcdatamodeld in my case) was in the "Compile Sources" list. The project compiled cleanly when I removed it from the list.

  1. Open the project navigator and select the project (very first entry at the top)
  2. Select your build target under Targets in the "Projects and Targets" pane
  3. Select Build Phases option near the top
  4. Expand the "Compile Sources" entry and look for your data model name. Search for "xcdatamodeld" if you have trouble finding it.
  5. Delete the model from the compile list
  6. Make sure the data model is included in the "Copy Bundle Resources" list. Add it if it is missing.
查看更多
疯言疯语
3楼-- · 2019-01-03 20:43

So the problem I was having is that I had accidentally included the Info.plist in the project settings -> Build Phases -> Copy Bundle Resources for my target.

查看更多
劳资没心,怎么记你
4楼-- · 2019-01-03 20:43

This basically means you have multiple files named Info.plist; Usually it's fine, but accidentally yours files are set to the same Target Membership. So the fix is: click each each file and check their Target Membership on the right, make sure they don't overlap.

查看更多
Rolldiameter
5楼-- · 2019-01-03 20:44

Try all this option anyone of this 3 option will work for you, for sure

Option 1: Remove all files from

Target >> Build Phases >> Compile Sources

Target >> Build Phases >> Copy Bundle Resources

Option 2: Change the build system

Xcode->File->Project Settings-> Build System -> Legacy Build System

Option 3: remove and update existing pod

pod cache clean PromisesObjC
pod cache clean PromisesSwift
cd [your_project_dir]
rm -rf Pods/
rm Podfile.lock
pod update

I hope this will help you, Happy coding :-)
查看更多
疯言疯语
6楼-- · 2019-01-03 20:46

Try this as well. Xcode->File->Project Settings-> Build System -> Legacy Build System.

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

In my case PDFGenerator was producing an info.plist file, I just deleted it.

enter image description here

查看更多
登录 后发表回答