You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Flutter iOS开发Xcode报错:找不到libarclite_iphonesimulator.a文件

解决Xcode构建Flutter项目时找不到libarclite_iphonesimulator.a的问题

这个错误多因Xcode 14+移除了libarclite库,但项目或依赖的最低部署目标低于iOS 13所致。以下是几种可行的解决方法:

方法1:统一项目和依赖的最低iOS版本到13.0或更高

  • 打开Flutter项目的ios/Podfile文件,将platform :ios, '9.0'修改为platform :ios, '13.0'
  • 用Xcode打开ios/Runner.xcworkspace,选中Runner target,在General标签的Deployment Info里,把iOS Deployment Target设为13.0或更高
  • 依次执行以下命令:
    flutter clean
    cd ios
    pod deintegrate
    pod install
    cd ..
    flutter pub get
    

方法2:手动添加libarclite库(仅临时应急,不推荐长期使用)

如果无法升级最低iOS版本,可从旧版Xcode(如Xcode 13)中复制对应库文件:

  • 找到旧Xcode路径/Applications/Xcode_13.x.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/arc/
  • 复制libarclite_iphonesimulator.a和libarclite_iphoneos.a到当前Xcode的对应目录/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/arc/
  • 重新构建项目

方法3:修改Podfile强制忽略libarclite链接错误

在ios/Podfile末尾添加以下代码,阻止CocoaPods自动添加libarclite依赖:

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      # 移除libarclite相关链接标记
      config.build_settings['OTHER_LDFLAGS'] = config.build_settings['OTHER_LDFLAGS'] || []
      config.build_settings['OTHER_LDFLAGS'].delete_if { |flag| flag.include?('libarclite') }
      # 统一依赖的最低部署目标
      config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0'
    end
  end
end

执行pod install后重新构建项目

内容的提问来源于stack exchange,提问作者fazal ur Rehman

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.10 07:11:01