简体   繁体   中英

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

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

在此输入图像描述

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

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.

The easiest and most common fix:

You can uncheck "Include Bitcode" when submitting the app via Xcode. 取消选中此框

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

我只是取消选中“include bitcode”并开始上传

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 在此输入图像描述
  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

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.

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.

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)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM