问题描述
问题:打包后,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
)的获取可以参照截图,如下:
网友评论