I have a SwiftUI app that I've been working on in XCode 16.1. The project builds and runs in the simulators, on my mac and on my iPhone/iPad without any issues. I'm also able to build my unit test project and run them without any errors. The project has zero warnings in it.
When I go to the Edit Schemes options and change the Run scheme to be a Release build with the Debug Executable
unchecked I get a compiler error:
Command SwiftCompile failed with a nonzero exit code
I've attempted this Release Run
with the following target devices in XCode:
- My iPhone 15 Pro Max (iOS 18.2 Beta 3)
- MacBook Air (M1) (15.2 Beta)
- iPhone 16 Simulator (iOS 18.1)
- Any iOS Simulator Device (arm64, x86_64)
All 3 of these target have the same issue. Normally I would just debug the error from the logs but when I look at the build output I can't see any information in the log to tell me what happened. It looks like the source files are sent into the SwiftCompiler and the compiler fails without bubbling up the issue.
I've provided the full error log export as a Gist HERE due to it's size. Is there anything in the log I'm missing? Is there a way for me to turn on more verbose logging during compilation of a Release Build?
I created a brand new Multiplatform App in XCode and I added all of my source files to it. No project configuration settings were changed. I could build it successfully with the debug configuration. I then changed it to the Release configuration and experienced the same error. I can create another fresh project and make the same release configuration with none of my source files in it and get a successful build. I
t seems there is something wrong with my source files and the release configuration but the compiler doesn't indicate what. I'm lost at this point as I can't figure out how to get a release build and can't seem to find any indication as to why.
anzbert, That is definitely not the same error as Scionwest2 is seeing. Note how in your case the compiler is crashing. That’s the typical case that I mentioned above:
Normally when I see this error it’s because the compiler has out’n’out crashed, and there’s at least some diagnostic info in the full build log.
That’s not what Scionwest2 was seeing, which is what makes their case so interesting.
In your case, however, you are seeing the compile crash (well, trap at an assert). That’s a more common problem.
My general advice for compiler crashes is to do your best to isolate the code into a small test project and then file a bug with that project attached.
Please post your bug number, just for the record.
Superabundant, If you’re seeing the compiler crash then it’s definitely not the same problem, as I explained above.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"