处理错误 Xcode 编译找不到文件 libarclite_iphonesimulator.a

处理错误 Xcode 编译找不到文件 libarclite_iphonesimulator.a

视频

https://youtu.be/ZBMFs2PwkB4

错误描述

Error (Xcode): File not found: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/arc/libarclite_iphonesimulator.a

Error (Xcode): Linker command failed with exit code 1 (use -v to see invocation)

分析

libarclite_iphonesimulator.a 这个文件是 ARC 自动释放内存的功能。

引起的问题是你的项目很新,但是编译目标太老,然后呢,没有这个文件。

你需要把这个文件复制到 .../arc/ 目录下。

还有一个办法直接修改 IPHONEOS_DEPLOYMENT_TARGET 编译目标为 ios 11,就好了。这只对新项目有效。

解决

代码方式

ios/Podfile

批量修改所有的依赖项目标版本号

post_install do |installer|
  installer.pods_project.targets.each do |target|
    flutter_additional_ios_build_settings(target)

    # add 修改项目配置
    if target.platform_name == :ios
      target.build_configurations.each do |config|
          config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '11.0' # 将11.0替换为您需要的目标版本号
      end
    end
    # add end

  end
end

执行命令

$ cd ios
$ pod update

手动方式

手动修改每个依赖包的部署最小版本为 ios 11.0

image-20230619161346714

可能遇到的问题

[!] Invalid Podfile file: [!] Specifying multiple post_install hooks is unsupported

这个错误意味着您在 Podfile 文件中指定了多个 post_install 钩子,而 CocoaPods 不支持这种做法。要解决这个问题,您需要将多个 post_install 钩子合并为一个。


© 猫哥 ducafecat.com

end

本文由 mdnice 多平台发布

  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值