When I try to build my app with Xcode, an error interrupts the build process:
Command
CompileStoryboard
failed with a nonzero exit code
Sometimes, it shows this error instead:
Command
CompileSwift
failed with a nonzero exit code
I have New Build System turned on.
What can I do to fix this?
I also facing same issue in xcode 10 and tried all the solutions provided but nothing working.
Then I deleted all the files and folders of the following folder :
and it worked like a charm.
The targets should be specified with related data such as appicon
Since this issue looks to have dozens of possible solutions and the root cause could be very vague, I'll throw my situation into the ring. Half of my pods were failing with some sort of
CompileSwiftSource
failure, but only on archive. I was still able to build for device and simulator just fine. I tried a lot (if not all) of the solutions suggested here with no luck. One of the pods had a slightly different error before theCompileSwiftSource
error so I went to updating and trying to fix that single pod. It was theCache
library for iOS which hadn't been updated in a while. There was a fork that resolved the issue with updating to Xcode 10.2 that I was able to update to and after that, all of the other issues took care of themselves. So look for a single outlier in your pods if you're getting a bunch of them erroring out and start there.Alright, I was having the same problem with Xcode 10. I usually use a storyboard for every view, that way if someone is helping it's easier to fold code in. I needed to make one of the view on one storyboard the initial view Controller.
Closing Xcode for me didn't have an effect. Instead, I cleaned the project using CommandShiftK.
I also found another reason: I had a storyboard reference to another storyboard which I had removed. The quick fix was deleting this.
Command CompileSwift failed with a nonzero exit code
This error happens when you are migrating your code from Xcode 9 to Xcode 10+. It due to any class name is conflicting with existing apple classes. For Example: State, Event etc.
So first change the class/structure name if any existing in your code like "State" to "StateDetail"
If Info.plist is added in target, remove tick mark from it so it will not copy app bundle (Latest Xcode10 security reason).
And build code again!!!