从Xcode 14 Release Notes可以看到,目前最低支持版本已经提到了 iOS11,并且自然而然的移除了无法升级iOS11 的armv7, armv7s, and i386。

这导致了我们打包遇到第一个问题架构报错

error: The armv7 architecture is deprecated. You should update your ARCHS build setting to remove the armv7 architecture. (in target 'Pods-packager' from project 'Pods')
error: The armv7s architecture is deprecated. You should update your ARCHS build setting to remove the armv7s architecture. (in target 'Pods-packager' from project 'Pods')

通过修改Cocoapod Package中的builder.rb 的 ARCHS 为 $(ARCHS_STANDARD)

修改后为。

def ios_build_options
   "ARCHS='$(ARCHS_STANDARD)' OTHER_CFLAGS='-fembed-bitcode -Qunused-arguments'"
end

builder.rb可以根据自己安装位置找到这个根据自己安装ruby版本确定

同时修改pod_utils.rb文件 

unless static_installer.nil?
  static_installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['CLANG_MODULES_AUTOLINK'] = 'NO'
      config.build_settings['GCC_GENERATE_DEBUGGING_SYMBOLS'] = 'NO'
      config.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = 'arm64', 'i386' // <-- inserted here
      config.build_settings['EXCLUDED_ARCHS[sdk=iphoneos*]'] = 'armv7s', 'armv7' // <-- inserted here
    end
  end
  static_installer.pods_project.save
end

保存后重新使用  Cocoapod Package。

原文地址:https://blog.csdn.net/sky_long_fly/article/details/129355409

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任

如若转载,请注明出处:http://www.7code.cn/show_44464.html

如若内容造成侵权/违法违规/事实不符,请联系代码007邮箱suwngjj01@126.com进行投诉反馈,一经查实,立即删除

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注