go to index

Xcode 编译提示 Missing file libarclite_iphoneos.a错误的解决办法

read time 1 min read
Xcode Pod

概述

在使用 Xcode 编译项目时,可能会遇到以下错误提示:

plaintext
File not found: /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/arc/libarclite_iphoneos.a

本文将介绍如何解决这一问题。

错误描述

编译过程中出现如下错误信息:

plaintext
File not found: /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/arc/libarclite_iphoneos.a

解决办法

修改 Podfile

为了解决这个问题,需要在你的 Podfile 中添加相应的配置。根据项目的最小 iOS 编译版本(如 11.0、12.0 等),设置 IPHONEOS_DEPLOYMENT_TARGET。例如,对于最小支持版本为 13.0 的项目,可以在 Podfile 中加入如下内容:

对于普通项目

ruby
post_install do |installer|
  installer.generated_projects.each do |project|
    project.targets.each do |target|
      target.build_configurations.each do |config|
        config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0'
      end
    end
  end
end

对于 Flutter 项目

ruby
post_install do |installer|
  installer.generated_projects.each do |project|
    project.targets.each do |target|
      target.build_configurations.each do |config|
        config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0'
      end
    end
  end
  installer.pods_project.targets.each do |target|
    flutter_additional_ios_build_settings(target)
  end
end