Xcode 11.4 - Archiving project - Segmentation Fault 11
For me helped to find the problem when I set in build settings the SWIFT_COMPILATION_MODE
to wholemodule
. Then after compiling got a more specific error which led to class function which caused the error.
Afterward changed it back as it was.
Maybe it helps you also.
In my case, there was used ternary operator for init input param set. Seems like Swift 5.2 don't support it anymore.
// Leads to error with Xcode 11.4
init(value: UIColor = Constants.staticBoolean ? .white : .green)
I have run into the same issue. Archiving uses the Release building configuration so I went through every compiler setting to work out which of the differences lead to these Segmentation faults.
In my case the problem disappears when I change the setting Enable Testability to YES for Release.
No I have no idea what the downsides to this are in the archive or release build, or indeed why this particular setting alleviates the problem, but at the end of the day, I have a project that has taken a year to get to this stage and I'm very keen to get this to internal beta testers so I am going to submit this through test flight and see how I go.
My feeling is this is definitely an Apple bug, as the compiler should not be Seg Faulting at all. The fact it compiles under the Debug configuration lends support to this. My project is so large that I don't know how to reproduce this to submit a bug, but I'll see if I can get some response on the Apple Forums.