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

Flutter项目Xcode编译报错:缺失libarclite_iphonesimulator.a文件求助

修复Xcode构建Flutter项目时libarclite_iphonesimulator.a缺失问题

方案1:调整项目Deployment Target版本

  • 打开Flutter项目的ios/Runner.xcworkspace
  • 在Xcode中选中Runner target,进入General标签页
  • 将Deployment Info里的iOS Version调整为iOS 11.0或更高
  • 依次执行flutter clean、flutter pub get、cd ios && pod install,再尝试构建

方案2:手动添加libarclite库(适用于必须保留低版本Target的场景)

  • 从Xcode 13或更早版本的工具链中复制libarclite_iphonesimulator.a和libarclite_iphoneos.a文件
  • 将文件粘贴到路径:/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/arc/
    • 若arc文件夹不存在,手动创建该文件夹
  • 重启Xcode后重新构建

方案3:清理缓存并重置构建环境

  • 执行以下命令清理缓存:
    flutter clean
    rm -rf ios/Pods
    rm ios/Podfile.lock
    rm -rf ~/Library/Developer/Xcode/DerivedData
    
  • 重新安装依赖:
    flutter pub get
    cd ios && pod install --repo-update
    
  • 回到项目根目录,执行flutter run重新构建

方案4:检查Podfile配置

  • 打开ios/Podfile,确保顶部的platform :ios版本与项目Deployment Target一致,示例:
    platform :ios, '11.0'
    
  • 若第三方插件指定了过低的iOS版本,可在Podfile中添加全局配置强制统一:
    post_install do |installer|
      installer.pods_project.targets.each do |target|
        target.build_configurations.each do |config|
          config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '11.0'
        end
      end
    end
    
  • 执行pod install后重新构建

方案5:验证Xcode工具链路径

  • 检查当前Xcode工具链路径:
    xcode-select -p
    
  • 若输出不是/Applications/Xcode.app/Contents/Developer,执行命令切换:
    sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
    
  • 重启Xcode后重新构建

内容的提问来源于stack exchange,提问作者Luca_54

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.07.26 02:05:01