Command failed due to signal: Segmentation fault: 11 while archiving

Try disabling Swift Compiler Optimization for Release

Then if you get any errors for missing files:

In the file inspector of the file click on the folder icon next to "Location" and locate the file manually


In my case, I tested all solutions including disabling optimization in the build settings:

Build Settings > Optimization Level > Release > No optimization [-Onone]

I don't recommend the above solution since this will affect your entire app and your final binary won't be optimized.

Based on contact with technical team at Apple, There are multiple reasons that could lead to this error, however there's a known bug for archiving during optimization and you need to bypass it by finding the place that compiler is failing and add @_optimize(none) at the top of your function that's causing the issue.

This attribute will tell compiler to ignore the function for optimisation.

class MyNavigationController:UINavigationController {

    @_optimize(none)
    init(navigationController: UINavigationController?, context: AppContextProtocol) {
      // content
    }
}