When I try to build my app with Xcode, an error interrupts the build process:
Command
CompileStoryboard
failed with a nonzero exit code
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!!!
I tried a lot of the options discussed here.
Nothing worked. I'm using Xcode Version 11.0 beta (11M336w).
Finally I downloaded a fresh copy and replaced the one I had previously installed. It was the same exact version. That did the trick.
The targets should be specified with related data such as appicon
When you stop building a project when the compiler is in the middle of something "important", this error could appear. In that case, building the project again and letting it finish normally makes this error disappear.
I have faced similar problem. I have done
Legacy Build Settings
- didn't worktypedef NS_ENUM
in .h file and enums related works. Build the system and build success shown. Next un-comment the code and build again - Magically worksIn my case, I used too complicated initializations inside a class extension. It suddenly broke my build.
class MyClass { }
extension MyClass {
static var var1 = "", var2 = "", var3 = "", var4 = "", ...., var20 = ""
}
Resolved:
class MyClass { }
extension MyClass {
static var var1 = "",
static var var2 = "",
static var var3 = ""
static var var4 = "", ....,
static var var20 = ""
}