'Invalid bitcode version (Producer: '902.0.39.2_0' Reader: '900.0.37_0')'

I'm using Xcode 9.0.

My pod file:

pod 'Alamofire', '~> 4.3'
pod 'SwiftyJSON'
pod 'AlamofireSwiftyJSON'
pod 'KSToastView', '0.5.7'
pod 'SDWebImage', '~> 4.0'
pod 'NVActivityIndicatorView'   
pod 'Firebase/Core'
pod 'Firebase/Messaging'
pod 'CarbonKit'
pod 'SBPickerSelector'
pod 'SwiftyStoreKit'    
pod 'Fabric'
pod 'Crashlytics'
pod 'SAMKeychain', '1.5.2'

My error log:

ld: could not reparse object file in bitcode bundle: 'Invalid bitcode version (Producer: '902.0.39.2_0' Reader: '900.0.37_0')', using libLTO version 'LLVM version 9.0.0, (clang-900.0.37)' for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

I read many articles for this issue but I'm not able to solve it. I referred to this, and yes, this takes note that I want to build archive my project with

configuration = Debug
configuration = Release
completeSettings = some

Any suggestions?

This is because you have some dependencies in your project (frameworks) that is built with a newer version of Xcode.

You have to update your Xcode version, or disable bit code in your project (Project > Build Settings > Enable Bitcode = NO)

As Rivera said, some libraries you use expect Xcode 10 (probably Firebase). So the workaround is to downgrade versions of your libraries. For me those versions works well with Xcode 9 and bitcode enabled option:

  pod 'Firebase/Core', '~> 4.13.0'
  pod 'Fabric', '~> 1.7.0'
  pod 'Crashlytics', '~> 3.9.0'

Probably you should also investigate which old version of Firebase/Messaging to use.

BTW, that is one of the reasons why developers should avoid using pods without specifying the specific version (which will lead to always download the latest versions of pods). It also may lead to version incompotability with your code which is using pod features.

Some libraries you use expect Xcode 10 (probably Firebase). Use Xcode 10.

  • Possible duplicate of error: Invalid bitcode version (Producer: '800.0.35.0_0' Reader: '703.0.31_0')
  • Very helpful answer, thanks! I set it to No and built an Archive. Then upgraded my Xcode version and was able to build an Archive again.
  • I believe this is not a real solution but workaround. You just disabled bitcode in entire project.
  • Apple now suggests bitcode to be turned on. Disabling it does not really resolve this problem.
  • Setting Bitcode to No doesnt allows upload of dysm file to upload on tesflight which is not a correct option. I believe this on is the correct answer.
  • i know that but my question is how can build make a build with Enable Bitcode = YES option .
  • As i know, you should use a newer version of Xcode.
  • its affect my other old project. so now i don't do this thank you for your replay.
  • yes might be but i don't want to upgrade my Xcode because its affect my older project so.
  • It shouldn't. Upgrading Xcode doesn't update your Swift version, files format or changes any build parameter. Just give it a try and ignore any suggested new settings.