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

<img src="https://ducafecat.oss-cn-beijing.aliyuncs.com/podcast/2023/06/fc2974a96caa626570adbb0b3d46c828.jpeg" style="width:90%;" />

视频

https://youtu.be/ZBMFs2PwkB4

谬误形容

Error (Xcode): File not found: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/arc/libarclite_iphonesimulator.aError (Xcode): Linker command failed with exit code 1 (use -v to see invocation)

<img src="https://ducafecat.oss-cn-beijing.aliyuncs.com/podcast/2023/06/6e8f56e4554fb27fc9a4511101c7a512.png" style="width:90%;" />

剖析

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  endend

执行命令

$ cd ios$ pod update

手动形式

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

<img src="https://ducafecat.oss-cn-beijing.aliyuncs.com/podcast/2023/06/a975ac6a003c380a8335357357c5f32b.png" alt="image-20230619161346714" style="zoom:50%;" />

可能遇到的问题

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

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


© 猫哥
ducafecat.com

end

本文由mdnice多平台公布