美文网首页iOS开发者进阶@IT·互联网
Invalid Bundle Executable. The e

Invalid Bundle Executable. The e

作者: __Mr_Xie__ | 来源:发表于2024-12-08 18:55 被阅读0次

问题描述

问题:打包后,SDK里面包含bitcode,上传审核时无法通过,报错如下:
Invalid Bundle Executable. The executable file 'xxx.app/Frameworks/SaicReportSDK.framework/SaicReportSDK' contains incomplete bitcode. To compile binaries with complete bitcode, open Xcode and choose Archive in the Product menu. (ID:c5d4f805-60ed-46ca-a9b7-9a9c494cadOc)

解决方法

Podfile文件中配置一下,即在post_install do |installer|里面添加脚本如下:

bitcode_strip_path = `xcrun --find bitcode_strip`.chop!
  def strip_bitcode_from_framework(bitcode_strip_path, framework_relative_path)
    framework_path = File.join(Dir.pwd, framework_relative_path)
    command = "#{bitcode_strip_path} #{framework_path} -r -o #{framework_path}"
    puts "Stripping bitcode: #{command}"
    system(command)
  end
  framework_paths = [
    "/Pods/SaicReport/Build/Products/SaicReportSDK.framework/SaicReportSDK"
  ]
  framework_paths.each do |framework_relative_path|
    strip_bitcode_from_framework(bitcode_strip_path, framework_relative_path)
  end

项目中示例如图:


然后执行pod install就解决了。
⚠️上面脚本中路径(即/Pods/SaicReport/Build/Products/SaicReportSDK.framework/SaicReportSDK)的获取可以参照截图,如下:

相关文章

网友评论

    本文标题:Invalid Bundle Executable. The e

    本文链接:https://www.haomeiwen.com/subject/cuggsjtx.html