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

IosXcode

Ios Problem Overview


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)...

Ios Solutions


Solution 1 - Ios

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.

Solution 2 - Ios

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

Solution 3 - Ios

I just unchecked "include bitcode" and it started to upload

Solution 4 - Ios

For Carthage

  1. Open your libraries in your project folder (Carthage->Checkouts->[lib name])
  2. Then open each lib in Xcode
  3. Set Enable Bitcode - No in build settings enter image description here
  4. Do it for each lib in your list
  5. Build carthage carthage build --platform xxx

Then you can archive and submit to the Appstore successfully

Solution 5 - Ios

We were getting same error "Xcode - Error ITMS-90635 - Invalid Mach-O in bundle - submitting to App store" from last friday (3-june-2016) .. used the below mentioned 2 steps to get this done

Step 1:
Added code to pod file to mark 'ENABLE_BITCODE' = 'NO' in pods

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

Step 2:
Marked 'ENABLE_BITCODE' = 'NO' in pods for the project

Note: Tried with marking 'ENABLE_BITCODE' = 'YES' in pods and in my project too but as we are using twillio framework for calling which has a flag -read_only_relocs which does not allow compilation with 'ENABLE_BITCODE' = 'YES'. So if your app does not use any of such framework with -read_only_relocs then you can proceed with making 'ENABLE_BITCODE' = 'YES' as it will be good for your app.

Solution 6 - Ios

For those who are having build error after setting "Enable BitCode" to Yes. I have to update all the library.But,the easiest part is I use Cocoapods.So,please update all your pod project : (One by one) or All

Then set Enable BitCode to "No" before you archive.

Then Archive>>Upload>>It will pass this error.

Cheers.

Solution 7 - Ios

I had the same issue with project "ENABLE_BITCODE = YES" and dependencies "ENABLE_BITCODE = YES" on my CI with Xcode 7.3. Solution was updating Xcode to latest available version (7.3.1)

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionNuno GonçalvesView Question on Stackoverflow
Solution 1 - IosGuillaume L.View Answer on Stackoverflow
Solution 2 - IosMike SpragueView Answer on Stackoverflow
Solution 3 - IosYestay MuratovView Answer on Stackoverflow
Solution 4 - IosDimuthView Answer on Stackoverflow
Solution 5 - IosSwapnilView Answer on Stackoverflow
Solution 6 - IosThiha AungView Answer on Stackoverflow
Solution 7 - IosiuriimozView Answer on Stackoverflow