error: Invalid bitcode version (Producer: '800.0.35.0_0' Reader: '703.0.31_0')
Asked Answered
E

7

31

When I try to Archive my application on Xcode 7.3.1, I am getting following error:

error: Invalid bitcode version (Producer: '800.0.35.0_0' Reader: '703.0.31_0') clang: error: linker command failed with exit code 1 (use -v to see invocation)

I was able to successfully Archive my app yesterday, can any one please help me?

Effuse answered 10/8, 2016 at 13:40 Comment(5)
It very much looks as if you had created your app with XCode 8 beta and are now using XCode 7 for archiving. Or maybe XCode mixes up a the two versions during the build process (compiling with version 8 and linking with version 7).Grosso
No. i had created my application using Xcode 7.3.1Effuse
But you have or had XCode 8 beta installed, right?Grosso
Not yet still i am using Xcode 7.3.1 , Not yet installed Xcode 8 Beta VersionEffuse
Then you mostly are using a third-party library that has already been compiled with XCode 8. Check in detailed log (right-most icon at the top of the left pane) if the linker has output a more specific message about what file is the cause of the problem. This might help diagnose the problematic library. Then revert to an earlier version of that library.Grosso
K
30

i had this error before ... you may try the following solution it worked for me

search for bitcode keyword in app --> Build Settings and change it to NO then archive again -->

it should work fine now

enter image description here

Kinnikinnick answered 1/1, 2017 at 20:39 Comment(1)
This helped me. Some good explanations about bitcode and links to articles with pros/cons are here: https://mcmap.net/q/15635/-what-does-enable_bitcode-do-in-xcode-7Foresight
T
12

Install Xcode 8: https://developer.apple.com/download/

Xcode 8 GM seed may be used to submit apps to the App Store.

More info: In my case I updated to the latest Facebook iOS SDK 4.15.1. Since that library was updated with Xcode 8 and I was still using Xcode 7.3.1 it caused the error.

https://developers.facebook.com/docs/ios/change-log-4.x

Updated for Xcode 8 GM and iOS 10.

So, double check 3rd party libraries.

Or if you don't mind disabling bitcode: Go to build settings search bitcode and change "Enable Bitcode" to "No".

Totalitarian answered 10/9, 2016 at 23:8 Comment(1)
Edited answer to suggest installing Xcode 8 to fix the issue.Totalitarian
N
9

I also faced the same problem, and as suggested by @Nate, the issue was because of a third party SDK integrated in our project using Cocoapods.

To help me figure out which one of the 15 pods i had in the project was responsible, i did the following:

  1. Create a new xcode project
  2. Copy the Podfile from your original project to the newly created project's directory
  3. Do pod install
  4. Remove one or more of the pods⋆
  5. Archive the new project, and see if it succeeds, if not repeat step 4 till you are able to archive

⋆(you can also try something like binary search, wherein you delete the first half pods in your Podfile and see if the new project archives)

Once you've figured out the library causing the issue, keep downgrading the library by explicitly specifying the version in Podfile, until the project archives successfully. And then you can use that version of the library to archive and upload to the app store.

Nilsanilsen answered 22/10, 2016 at 19:54 Comment(2)
In my case compiler already shown that Flurry-iOS-SD causing the problem, simply downgrading by one step resolve the problem.Suspense
This debugging idea helped me get to the root cause. Thanks for the suggestion!Podvin
A
5

If you are using lib or pod that mean that one of them built by a higher version of your current Xcode, you can either update your code or return back to the previous version where the pods were built by your current version. If you ran pod update check the pods updated if you ran pod install check the dates of the pods comparing to the release date of your Xcode that will will lead you to the responsible pod.

I got it while I was building using Xcode 8.2.1 and the pod built by Xcode 8.3.1

Airspeed answered 16/4, 2017 at 12:36 Comment(1)
xcode_select "/Applications/Xcode\ 83.app" in Fastfile fixed the problem. (I have 3 version of Xcode installed.)Danika
G
2

I also faced this error: Invalid bitcode version (Producer: '800.0.24.1_0' Reader: '703.0.31_0') I have googling so many but unable to find the proper solution. I tried Myself and solved this probable In my case this error occurs after adding FBSDK by drag and drop that we all usually do.
You can resolve this problem by following these steps:

  1. Delete all pod script in build Phases.
  2. Delete the dragged FBSdks file from the project.
  3. Exit xcode and delete 3 things "Pod folder","Podfile.lock" and "Projectworkspace"
  4. Search and add FBSDK pod link in podfile
  5. Install the pod again by using terminal.... now open Xcode archive your project build.
Groves answered 10/11, 2016 at 9:15 Comment(1)
You save my day mate.Stocky
P
2

good solutions, but disabling bitcode worked for some people.

edit :- it worked for me too. but in future your app might be in problem or (build not optimised by Appstore) if your project is **Bitcode Disable **.

Bitcode is an intermediate representation of a compiled program. Apps you upload to iTunes Connect that contain bitcode will be compiled and linked on the App Store. Including bitcode will allow Apple to re-optimize your app binary in the future without the need to submit a new version of your app to the store.

Note: For iOS apps, bitcode is the default, but optional. If you provide bitcode, all apps and frameworks in the app bundle need to include bitcode. For watchOS apps, bitcode is required

So thats why try to figure out error solutions right way.

Phosphatize answered 10/11, 2016 at 16:0 Comment(0)
O
1

The error basically says:

The static linker could not correctly link a certain bitcode bundle, which was produced using Producer: '902.0.39.2', and is being read using Reader: '900.0.37'.

You can look up at https://gist.github.com/yamaya/2924292 to identify the Xcode versions for the corresponding compiler versions. In the current case, the reader (our Xcode version) is Xcode 9.0, whereas the producer (Xcode version of typically a third party SDK) is Xcode 9.4. The incompatibility between the two is the root cause of this issue.

You may either:

  • turn off the bitcode as discussed in other answers, or
  • roll-back the SDK to a previous version that worked well, or
  • update your codebase to use the newer Xcode version.
Overbear answered 19/6, 2020 at 7:52 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.