美文网首页
Xcode升级到14.3 Pod报错

Xcode升级到14.3 Pod报错

作者: 羽化行云 | 来源:发表于2023-04-26 15:07 被阅读0次

如果你的项目使用Xcode14.3,但是最低iOS版本为11.0,不需要修改,如果最低iOS版本不是11.0,可能项目运行时就会报错,该方式只针对最低iOS版本不是11.0引发的错误,做如下修改.

原因:Xcode14.3 移除了ARC目录

根据项目分两种:

原生项目

目的: 将最低版本修改为iOS12.4

  post_install do |installer|
    installer.pods_project.targets.each do |target|
      target.build_configurations.each do |config|
        config.build_settings["IPHONEOS_DEPLOYMENT_TARGET"] = "12.4"
      end
    end
  end

ReactNative项目

目的: 将最低版本修改为iOS12.4

    # 新添加的将最低版本改为12.4
  post_install do |installer|
    installer.pods_project.targets.each do |target|
      target.build_configurations.each do |config|
        config.build_settings["IPHONEOS_DEPLOYMENT_TARGET"] = "12.4"
      end
    end
  
    # ReactNative pod集成自带
    react_native_post_install(
      installer,
      # Set `mac_catalyst_enabled` to `true` in order to apply patches
      # necessary for Mac Catalyst builds
      :mac_catalyst_enabled => false
    )
    __apply_Xcode_12_5_M1_post_install_workaround(installer)
  end

注意⚠️:如果你的pod即需要设置最低版本,又需要M1、M2电脑支持模拟器设置arm64,那么请将设置arm64放到设置最低版本之后,不然可能还是会报错

  post_install do |installer|
    installer.pods_project.targets.each do |target|
      target.build_configurations.each do |config|
        config.build_settings["IPHONEOS_DEPLOYMENT_TARGET"] = "12.4"
      end
    end
    react_native_post_install(
      installer,
      # Set `mac_catalyst_enabled` to `true` in order to apply patches
      # necessary for Mac Catalyst builds
      :mac_catalyst_enabled => false
    )
    __apply_Xcode_12_5_M1_post_install_workaround(installer)
    # 注意:放到该位置不要动
    installer.pods_project.build_configurations.each do |config|
      config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
    end
  end

相关文章

网友评论

      本文标题:Xcode升级到14.3 Pod报错

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