15

I just upgraded to Xcode 10, and I suddenly face this error when I try to build, any ideas how to fix it? I tried cleaning derived data, but without any luck.

enter image description here

1
  • Sorry for the down-vote, but (1) a screenshot is not a good way to ask, particularly when (2) you whiteout things - even if they don't matter. Mostly though? (3) I (barely) can make out "simulator" and "Copy Pods...." which suggest avenues of issues you haven't given us any details on - like your project dependencies?
    – user7014451
    Commented Sep 19, 2018 at 1:23

7 Answers 7

33

If you use CocoaPods, click Xcode menu file -> Workspace Settings , And click Build system choice Legacy Build System

https://i.sstatic.net/FqiID.png

If you not use CocoaPods, same of top , select Project Settings

5
  • how is cocapods relate to this issue ? I have a project with cocapods on the it's run with the new build system
    – XcodeNOOB
    Commented Oct 31, 2018 at 12:42
  • I tried it but just this stackoverflow.com/a/52451421/2238515 solved for me
    – Almeida
    Commented Nov 4, 2018 at 22:01
  • 4
    This worked for me, but why are we supposed to use 'Legacy build' system? Why can't we use new build system? Commented Nov 9, 2018 at 11:08
  • yes i was facing the same problem. i got the solution with your answer . thanx man
    – asif saifi
    Commented Feb 25, 2019 at 6:28
  • I am using Carthage and this helped. Thank you very much. But what was the problem and why does this even work? Using legacy scares me because I don't know how long until the next version of Xcode is going to swap this out from under me.
    – huggie
    Commented Jun 20, 2019 at 8:47
6

If your app is generating the error related to the multiple .app files just like mentioned above in question then removing the .plist files from "Copy bundle Resources" WILL NOT WORK.

If the error is related to .app file then follow the following steps.

  1. Select the Target.

  2. Go to Build Phases tab.

  3. Remove the items listed in Output Files
  4. Compile the code if it compiles successfully then not follow the next steps.
  5. If code does not compile successfully and Xcode may give you an error related to "Library not found". Then add the missing library in General Tab in Linked Frameworks and Libraries that Xcode mentioned in the error.
  6. Keep adding these libraries (that Xcode ask through compile errors) in Linked Frameworks and Libraries until the code compiles successfully.

    Hope this helps.

0
4

You can try to change the build system to Legacy, File > Workspace Settings > Build System > Legacy Build System.

1

I also faced this issue in xcode 10 but it was because of adding the same framework in main project + other extensions (watchkit or siri extension etc). I added ObjectMapper in podfile for my main project + for my extensions. When I compiled it gave me an error that multiple command produce and also shows me which framework is causing this issue. Now its working fine for me as I've removed it from my extensions I wasn't using it in my extensions.

Don't know about your issue may be you can check your podfile.

1

If this is CoreData related. The issue is that you are trying to generate the NSManagedObject subclass but you need to set the 'CodeGen' option to Manual/None. This option is defaulted to Class definition and this would regenerate the code thus creating this issue.

0

i encountered this issue as well while working with CoreData.

in my .xcdatamodeld file, it came down to the fact that, during the creation of my various Entities, i had copy and pasted one multiple times (thinking i was saving time because various properties were similar enough that i thought this was a good idea).

the resulting Build error Xcode 10 - 'Multiple commands produce' occurred because i forgot to check and make sure the new Entities were set to their own unique corresponding class to match the new Entity in the Data Model Inspector pane.

unfortunately, it took me two days to figure out the original Entity's Class Name was still in place.

so lesson: careful when you copy/paste/duplicate Entities in CoreData. (... i guess :0} )

some time saver. oops! hope this helps someone.

0

I had this same issue with Core Data entity class. I had forgotten to select Codegen Manual / None because I do not allow mine to be autogenerated. So I had a class in place and also it was trying to generate one.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.