Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VSTS Build Generation throwing Invalid bitcode version error

To generate builds to testers we use VSTS in our project. When we checkout and run the branch in our mac with xcode, it works fine. But when i try to release a build through VSTS it throws error as below and the build fails.

ld: could not reparse object file in bitcode bundle: 'Invalid bitcode version (Producer: '902.0.39.2_0' Reader: '900.0.39.2_0')', using libLTO version 'LLVM version 9.0.0, (clang-900.0.39.2)' for architecture arm64

I understand that the issue might be because of the fact that there are two different versions of the compiler hanging around. I am using Xcode 9.2 and the server which builds the source code to upload also has Xcode 9.2. One more thing is, in past i have made a commit with beta Xcode version 9.4 to the branch. Can that create an issue or is it something else that i am missing here.

Also i hear from some stack-overflow and git suggestions that updating Xcode will fix the issue. I am fine with that but want to have that option as last because there are some servers and builds queued in the server like android and WebApp build which we have automated through VSTS which will be stopped momentarily.

Any help or pointers are much appreciated.

Note: Internally the VSTS server tries to archive the build. So the accepted answer in error: Invalid bitcode version (Producer: '800.0.35.0_0' Reader: '703.0.31_0') might provide the solution. But still the scenario is different as VSTS might try something different under the hood.

like image 645
Karthick Ramesh Avatar asked Jul 02 '18 02:07

Karthick Ramesh


3 Answers

In my case I disabled bitcode from Target enter image description here

but I did not disable bitcode from My Project enter image description here

I just change my project's settings bitcode to "No" and it's work....

like image 60
Muhammad Ahmed Baig Avatar answered Nov 19 '22 23:11

Muhammad Ahmed Baig


It happened to me when I was trying to create an archive of a project with a binary framework (in my case Crashlytics/Fabric). The framework was compiled using Xcode 9.4, but I was using Xcode 9.2 (looks like 900.0.39.2_0 is Xcode 9.2 and 902.0.39.2_0 is Xcode 9.4). I solved it by temporarily setting Enable Bitcode to No in Build Settings.

Note: Bitcode is not mandatory to submit an iOS app to the App Store. (However it is mandatory for Apple Watch apps.)

Another solution would be to downgrade the binary framework to an older version (built with a compatible version of Xcode).

like image 20
Marián Černý Avatar answered Nov 20 '22 01:11

Marián Černý


Found a solution for the problem that i was facing. As the issue reads, the VSTS server was having Xcode 9.2 which has 900.0.39.2_0 and hence updating the xcode version in the vsts server fixed the issue. The thing we need to take care is when we update the xcode version in local machine its better to update the xcode version in VSTS server to avoid such issues in future.

like image 3
Karthick Ramesh Avatar answered Nov 20 '22 01:11

Karthick Ramesh