项目构建(打包)架构错误

在开发过程中一切正常, 但是在构建构建项目的时候报了一个CPU架构错误, 错误如下:

` bitcode bundle could not be generated because ‘xxxxxxx’ was built without full bitcode. All object files and libraries for bitcode must be generated from Xcode Archive or Install build file ‘xxxxxxx’ for architecture armv7`

一般是由于pod中framework引用framework,但是他们对bitcode的支持不一致导致的, 解决办法为强制关闭bitcode

1
2
3
4
5
6
7
8
post_install do |installer|
  #关闭bitcode,涉及framework嵌套, 导致bitcode不一致,所以全部关闭
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['ENABLE_BITCODE'] = 'NO'
    end
  end
end