ITMS-90635: Invalid Mach-O format, consistent ENABLE_BITCODE Build Setting

In our IOS app, we have few libraries that do not spport BITCODE so we had ENABLE_BITCODE set to NO for the iOS APP and Yes for the Watch App.

And, this setting has worked for us in the past but now we are getting error during submission.


"ERROR ITMS-90635: Invalid Mach-o format"


The Error descriptions mainly says that all targets for a platform should have a consistent value of ENABLE_BITCODE.


Is bitcode now required for iOS Apps too if we have a Watch App?

Replies

We are having the same issue. Yesterday, our app submissions started failing with that error even though our code hasn't changed in the past two weeks (we submit multiple apps off of the same codebase).

I am seeing the same issue this morning. We have been able to submit with the same setting before with no issues.

I thinked to make a wrong thing in my project ! Ouf ! I'm not alone !


I have also the ERROR ITMS-90164: "Invalid Code Signing Entitlements" and somes WARNING ITMS-90080


EDIT: May be an answer here : http://stackoverflow.com/questions/37613550/xcode-error-itms-90635-invalid-mach-o-in-bundle-submitting-to-app-store

ok I just disabled "Enabled Bitcode" on Build Settings of each targets on my Pods project (I use cocoapods) and it works !!!

Having the same issue! Will disabling the BITCODE for the Pods cause the App to be reject by Apple?

I don't know because it's my first app but it has been pushed on itunes connect :/

Nope--as long as all of your frameworks+main binary have bitcode disabled, you should be good. Here's the snippet I added to my 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

Thanks Orel for linking to this: https://stackoverflow.com/questions/37613550/xcode-error-itms-90635-invalid-mach-o-in-bundle-submitting-to-app-store/37624641#37624641


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/watchos/releasenotes/DeveloperTools/RN-Xcode/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.

The text below describes the critera for submitting your app with bitcode. When you submit with XCode, you can uncheck "include bitcode" and it should work., unless of course bitcode is required for it. The bottom line is important, "If you provide bitcode, all apps and frameworks in the app bundle need to include bitcode."


To include bitcode, ensure that “Include bitcode…” is checked (bitcode is enabled by default).
Apps you upload to iTunes Connect that contain bitcode will be compiled and linked on the store. Including bitcode allows the store to apply updates to your app without requiring you to create a new version and resubmit it to App Review.

  • For iOS apps, bitcode is optional.
  • For watchOS apps, bitcode is required. If you uncheck this box, only the bitcode for the enclosed iOS app is removed.
  • For tvOS apps, bitcode is required so this checkbox doesn’t appear.
  • For Mac apps, bitcode is not supported so this checkbox doesn’t appear.

If you provide bitcode, all apps and frameworks in the app bundle need to include bitcode.


taken from:

I started getting this problem since I solved the warning message


"The executable '******/<Pod dependency>.framework' is not a Position Independent Executable. Please ensure that your build settings are configured to create PIE executables. For more information, refer to Technical Q&A QA1788 - Building a Position Independent Executable" .


I followed the steps describe in https://developer.apple.com/library/ios/qa/qa1788/_index.html#/apple_ref/doc/uid/DTS40013354. and perform clean - build. Build was successful. But when I choose "Generic iOS Devices", build failed with error message saying "-no_pie and -bitcode_bundle (Xcode setting ENABLE_BITCODE=YES) cannot be used together error". To fix this issue i changed option for "Enable Bitcode" to NO in Target. Things fixes the build problem. Now when I try to upload the archive to iTune connect it gave me the error you experienced and upload fail .


Now to fix this I unticked option "include bitcode" in upload dialog and upload worked as expected without any warning or error.

I've added code snippet to to my pod file and verified that all targets for the pods are set to NO.

However, it still gives me the same errors. The main project has ENABLED_BITCODE set to NO as well.

OK, I solved it, I missed to set the platform to iOS in the pod file.