xcode16解决bitcode问题

比如我的就出现了

Invalid Executable. The executable 'AKASO_GO.app/Frameworks
ZendeskSDKLogger.framework/ZendeskSDKLogger' cointains bitcode. (ID:
d5903d7b-2a72-4489-b87e-17b718590b3a)

什么是bitcode
Bitcode是上传到App Store的应用程序的标志。它允许苹果重新编译应用程序,以针对未来的硬件架构和设备进行优化,无需重新提交代码。从本质上讲,它为面向未来的iOS应用程序提供了灵活性。

解决方法(以下YourFramework均指相对应的某个framework)
1.如果是在项目中的

xcrun bitcode_strip -r YourFramework.framework/YourFramework -o YourFramework.framework/YourFramework

2.如果是cocoapods再post_install中加入如下代码

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/YourFramework/YourFramework/dynamic/YourFramework.xcframework/ios-arm64_armv7/YourFramework.framework/YourFramework",
  ]

  framework_paths.each do |framework_relative_path|
    strip_bitcode_from_framework(bitcode_strip_path, framework_relative_path)
  end
end
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容