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

VS Code中Flutter App启动失败,配置program仍报错求助

Flutter项目VS Code启动配置异常问题

我和两位同事协作开发一款App,通过Azure DevOps同步代码,使用VS Code作为开发工具。每次尝试运行main.dart时,都会收到提示:

Set the 'program' value in your launch config (eg 'bin/main.dart') then launch again

我的项目中main.dart实际位于lib目录,于是我在launch.json里分别尝试将program设置为bin/main.dart和lib/main.dart,但均出现以下错误:

ProcessException: No such file or directory...

Your launch config references a program that does not exist. If you have problems launching, check the "program" field in your ".vscode/launch.json" file.

我已经尝试过删除.vscode文件夹及其中的launch.json文件,重新创建launch.json后问题依旧。多次执行flutter doctor命令,确认Flutter环境配置无异常。当前launch.json的配置情况如下截图所示:
VS Code launch.json配置界面

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.07.25 22:17:08