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

尝试使用VS Code在真实设备运行Flutter应用报错,附报错及flutter doctor结果

Flutter 真机运行报错处理方案

问题场景

使用VS Code在真实设备上运行Flutter应用时触发报错,对应报错信息和flutter doctor运行结果如下:
运行报错截图
flutter doctor检测结果截图

修复步骤

  • 安装/更新CocoaPods
    终端执行命令:
    sudo gem install cocoapods
    若使用M系列芯片的Mac设备,额外执行以下命令:
    sudo arch -x86_64 gem install ffi
  • 重置项目iOS依赖
    进入项目根目录下的ios文件夹,依次执行:
    pod deintegrate
    pod install
  • 校验Xcode命令行工具配置
    终端执行:
    sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
  • 清理项目缓存重试
    回到项目根目录执行flutter clean,清理完成后重新运行应用即可。

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.10.04 23:51:03