• Xcode14 正式版编译报错‘ does not contain bitcode.解决方案


    Xcode更新到14版本后编译后报错:

    'xxx' does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. file 'xxx' for architecture arm64

    这是由于在Xcode14中放弃了bitcode,iOS 9、iOS 10,最小支持iOS 11,并不再支持构建 armv7、armv7s 以及 i386 架构的 iOS 项目,而以前的Xcode 是默认使用 armv7 和 arm64架构。

    去掉了armv7的优势是可以降低ipa包的大小

    直接上解决方案:推荐优先使用方法二

    方法一:

    首先关闭原项目中的ENABLE_BITCODE设为No。target --> Built Seeting -->搜索 ENABLE_BITCODE  --->将Yes置为No

    由于Xcode14不再支持iOS11以下的版本所以需要将build_settings中的IPHONEOS_DEPLOYMENT_TARGET设置为11.0

    推荐使用方案在Podfile中设置,如下所示:

    post_install do |installer|
        installer.pods_project.targets.each do |target|
            target.build_configurations.each do |config|
                config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '11.0'
            end
        end
    end

    最后重新Pod install

    注意 Target中的 Build settings--> iOS Deployment Target 也得设置iOS11.0

    另外还有Pod工程中的Bundle target签名报错,只要选择一下Bundle target 签名中的Team,与主工程一致即可,或者在Podfile中使用

    config.build_settings["DEVELOPMENT_TEAM"] = "Your Team ID"

    进行设置。

    方法二:

    如果上述方案还是报此错误使用如下方案:

    什么都不用改也不需要限制iOS11以上),只需要保证签名一致即可

    在Podfile中设置,如下所示:

    post_install do |installer|
        installer.pods_project.targets.each do |target|
            target.build_configurations.each do |config|
               
      config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '10.0'   

                  config.build_settings['ENABLE_BITCODE'] = 'NO'

                  config.build_settings['EXPANDED_CODE_SIGN_IDENTITY'] = ""

                  config.build_settings['CODE_SIGNING_REQUIRED'] = "NO"

                  config.build_settings['CODE_SIGNING_ALLOWED'] = "NO"
            end
        end
    end

    然后 Pod install 即可

  • 相关阅读:
    香港空间在http重定向https出现400状态码
    docker理论+部署(一)
    二十三、设计模式之组合模式![
    【App自动化测试】(七)移动端自动化中常见控件交互方法
    C语言之字符串
    Mysql 源码阅读(二)登录连接调试
    【Spring】spring管理第三方资源;加载Properties文件
    【基本算法题-2022.7.31】11. 分形之城
    [Git] 系列二高级命令学习记录
    机器学习/人工智能的笔试面试题目——最优化问题相关问题总结
  • 原文地址:https://blog.csdn.net/qq_37269542/article/details/126886285