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 got this error while trying to run my unit tests in a submodule. What I have done is:
Change the simulator => Clean the project => Build the project => Run unit tests.
After this, my unit tests ran without any issue.
What was causing these errors for me (I was getting 8+ for some of my cocoapods) was fixing any runtime build issues in all the pods.
I encountered this error when I was upgrading my project from Swift 4 to 5. I first updated all my pods to their latest versions. When I built, some pods showed this error.
The following steps resolved this issue for me:
Podfile
pod install
to remove all installed podspod deintegrate
to remove support for CocoaPodsPodfile.lock
and.xcworkspace
from my project so no CocoaPods anymore.xcodeproj
filePodfile
pod install
to reintegrate CocoaPods and add my pods.xcworkspace
fileNow I have only errors in my own project code related with difference in Swift version I made. My job now is to fix them.
In my case, I was clean build folder then restart my mac then it's work.
I have the issue like that and my solution is change a little thing in Build Settings:
it work to me
In my case it was about having a file named Location. after some digging I find out that it was about having two file with the same name (weird). Cause I don't, however, it's been solved by removing the file and adding another file with a different name.