Invalid bitcode version on Xcode 9.0 and Firebase 5.0.4

I have a project that uses Firebase Analytics 5.0.4 (Lastest). When I build my project with develop mode, everything is ok. But when my project archived, I have trouble. Xcode notifies me that:

"Invalid bitcode version (Producer: '902.0.39.1_0' Reader: '900.0.39.2_0'), using libLT0 version 'LLVM version 9.0.0, (clang-900.0.39.2)' for architecture arm64".

I use Xcode version 9.0 because Firebase says that they support xcode 9.0 and later.

I think that it relates Xcode version so I used Xcode 9.2 instead of Xcode 9.0, but this error didn't change. If I use Xcode 9.3 or 9.4, it will work ok?

Please tell me a solution.

Upvotes: 4

Views: 1795

Answers (2)

lobstah
lobstah

Reputation: 881

pretty late answer, but can be helpful for other people.

Your problem here is that one of the dependencies was built with a newer version of Xcode 9.3+. So, if you will use a newer version of Xcode - you won't meet this problem.

But, if you want to solve this problem and use Xcode 9.2 for some reasons, you need to find dependency which was built with newer Xcode and switch to an older version (for example by specifying exact version in your dependency manager ex: pod 'Crashlytics', '3.10.1' or github "Alamofire/Alamofire" == 4.7.2 for carthage).

Another possible case which can cause this error is using several version of Xcode on your computer. For example, you can build Carthage dependencies using Xcode 9.3+ and then try to archive project in Xcode 9.2. In this case, just do xcode-select and choose proper SDK.

Upvotes: 0

drshock
drshock

Reputation: 2126

I've seen this same error.

You have to be running Xcode 9.3 or higher to avoid this bitcode message. That might mean having to upgrade your MacOS version to High Sierra first as well in order to get there.

The error is because Firebase 5.0.4 is built with a newer compiler library than the iOS app in your situation. The xcode upgrade will bring things back in sync and allow the archive build flow to complete again.

Temporary workaround is, of course, to disable bitcode. But that's a temporary bandaid solution and not recommended for modern app store publishing.

Upvotes: 1

Related Questions