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

后端 未结 6 1750
遥遥无期
遥遥无期 2021-02-18 19:07

I\'m using Xcode 9.0.

My pod file:

pod \'Alamofire\', \'~> 4.3\'
pod \'SwiftyJSON\'
pod \'AlamofireSwiftyJSON\'
pod          


        
相关标签:
6条回答
  • 2021-02-18 19:20

    Steps to solve this issue:

    • Build Setting
    • Search Enable Bitcode option in Build Options category.
    • Select no.
    0 讨论(0)
  • 2021-02-18 19:22

    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.

    0 讨论(0)
  • 2021-02-18 19:23

    This could also happen if you have two different Xcode versions installed side by side and then building with one that points to wrong command line tools. I experienced this problem after installing Xcode 10.1 next to (updated) Xcode 10.2. My Xcode 10.1 was pointing to Xcode 10.2 command line tools, so linking failed with invalid bitcode version, same as in your case. The fix was:

    • Change Command Line Tools in Xcode Preferences -> Locations -> Command Line Tools:

    • Clean build folder and hit Archive.

    The above is also valid for other Xcode versions.

    0 讨论(0)
  • 2021-02-18 19:34

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

    0 讨论(0)
  • 2021-02-18 19:44

    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)

    0 讨论(0)
  • 2021-02-18 19:45

    There is a big chance that the Xcode version that compiled the pod sdk is higher than the one you are using.

    Next possible reason is the bitcode in build settings. Check if it is enabled on your app target and your framework target. If you have added vis cocoapods, click on pods project, under targets section, scroll down to the sdk which is giving this error, open the build settings and check for the bitcode status.

    In my case, the Main project had bitcode disabled and the sdk inside the pods project had it enabled. Disabled it and everything worked fine.

    0 讨论(0)
提交回复
热议问题