Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode - Error ITMS-90635 - Invalid Mach-O in bundle - submitting to App store

Tags:

xcode

ios

I just got this error when submitting an app to the app store.

enter image description here

Does this mean I need to set ENABLE_BITCODE for all dependencies? I tried that but then got errors saying the dependencies were not compatible with bitcode (or something like that)...

like image 320
Nuno Gonçalves Avatar asked Jun 03 '16 11:06

Nuno Gonçalves


2 Answers

I had the same problem earlier this morning. In fact the answer is in the error : "Verify that all of the targets for a platform have a consistent value for the ENABLE_BITCODE build settings"

I had a target (with ENABLE_BITCODE set to NO), using multiple pods having ENABLE_BITCODE set to YES. So, all I had to, do is set ENABLE_BITCODE to YES in my project target. But I guess you have a choice, you can also set ENABLE_BITCODE to NO in all the libs your are using.

like image 197
Guillaume L. Avatar answered Oct 19 '22 23:10

Guillaume L.


The easiest and most common fix:

You can uncheck "Include Bitcode" when submitting the app via Xcode. uncheck the box

If you use xcodebuild, you can use pass an exportOptionsPlist with the value of uploadBitcode set to false. In my case, we're using xctool to build the app and don't have the ability to pass an exportOptionsPlist, so we had to remove bitcode from all of our frameworks.


If anyone is using cocoapods and wants to disable bitcode for their frameworks, you can just add the following to your podfile:

post_install do |installer|   installer.pods_project.targets.each do |target|     target.build_configurations.each do |config|       config.build_settings['ENABLE_BITCODE'] = 'NO'     end   end end 

Via https://stackoverflow.com/a/32685434/1417922


To add a little more clarification as to what's going on with this issue:

It seems that apple just started enforcing this yesterday. If your main binary has bitcode disabled, but you include a static library or framework that has bitcode enabled, it will fail validation. It goes the other way too: if your main binary has bitcode enabled, but you include a library/framework that has bitcode disabled, it will fail validation.

I had a few dependencies from GoogleMaps and Amazon that made it non trivial to switch everything to enable bitcode, so I simply disabled it and removed bitcode from one static library I had imported in my project. You can strip bitcode from any binary by using this following command

$ xcrun bitcode_strip -r {Framework}.dylib -o tmp.dylib $ mv tmp.dylib {Framework}.dylib 

https://developer.apple.com/library/content/documentation/Xcode/Conceptual/RN-Xcode-Archive/Chapters/xc7_release_notes.html

While the above are solutions to the problem, I don't agree that if the main binary has bitcode disabled that all of the included binaries should need it as well. Bitcode is just some IR code that Apple can use for app thinning--why don't they just strip it from other binaries (which I assume is what they previously did)? This doesn't make a ton of sense to me.

Apple thread https://forums.developer.apple.com/thread/48071

like image 37
Mike Sprague Avatar answered Oct 20 '22 00:10

Mike Sprague