xcode16 bitcode的问题

遇到IMSDK构建上的Bitcode问题

上传到Apple TestFlight验证失败,出现错误,提示框架是用位码编译的,这是不允许的。只有在隐式设置位码时,问题才会出现在Xcode 16 RC上,在Xcode 15上构建应该可以正常工作。深入研究,我们看到一些有趣的行为:对于报告的框架,生成的IPA符号不包含它们应该存在的LLVM符号。这可能很棘手,因为一些过时的库或依赖项仍然有位码,无法快速更新。与Xcode 15相比,Xcode 16 RC似乎具有更严格的比特代码验证。解决方法是在构建之前剥离框架的比特代码。

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

如果您使用Cocoapod,您可以利用以下变通方法:

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

    "Pods/LibraryB/LibraryB.xcframework/ios-arm64_armv7/LibraryB.framework/LibraryB"

  ]

  framework_paths.each do |framework_relative_path|

    strip_bitcode_from_framework(bitcode_strip_path, framework_relative_path)

  end

end

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

推荐阅读更多精彩内容