Reputation: 46
I am trying to compile a Swift application for Archive (testing build), however i'm facing a very strange and isolated error:
error: Invalid bitcode version (Producer: '800.0.38.0_0' Reader: '703.0.31_0') clang: error: linker command failed with exit code 1 (use -v to see invocation)
The weird thing is the app compiles to a device, test suites run and a standard (CMD+B) build action all succeed. The only action that fails is Product > Archive.
Additional Information: I'm using Cocoapods and have confirmed all pods are looking at a Swift 2.3 branch and compatible with my app. Lastly, I tried this build on a completely different dev machine (MacPro) and have hit the same snag.
Newest Information: When I disable bitcode in Build Settings it compiles properly. I'm left to believe this is an issue with one of the pods, possibly not built with the proper flags. If anyone has further insight as i'd like to keep bitcode enabled, if at all possible.
Any help is greatly appreciated.
Upvotes: 2
Views: 1094
Reputation: 4437
I've got exactly the same issue after upgrading one of 3-rd party libraries. I guess this is because the 3-rd party library was built using Xcode 8 and I'm still on Xcode 7. See also this question on the topic (not yet answered).
Possible fixes would be to:
1) update the Xcode (but I didn't try it yet hoping to find a simpler solution)
OR
2) find out which of the libraries causes the error and either ask them for a fixed version or fallback to a previous version.
UPDATE: Option 2 helped me. The 3-rd party library developer (Bugsee) sent me a new framework compiled with Xcode 7 and everything works now.
Be careful updating 3-rd party frameworks if you are on an older Xcode version for some reason.
Upvotes: 2
Reputation: 2914
Disable ENABLE BITCODE
in Build Settings of your target and try to Archive
it. Disabling ENABLE BITCODE
does not have any adverse effect on product archive. Since this is an optional flag for Apple, so you can disable it unless Apple makes it required flag in the future. For more details, you can refer to Bitcode Enabling/Disabling
Upvotes: 4