我无法启动我的 flutter 应用程序,这是我在尝试使用 debbug 运行但没有 Debug模式时收到的消息:
您的启动配置引用了一个不存在的程序。如果启动时遇到问题,请检查“.vscode/launch.json”文件中的“程序”字段。
默认情况下我的 .json 文件:
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Dart",
"program": "lib/main.dart",
"request": "launch",
"type": "dart"
}
]
我运行 flutter doctor:
[!] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses
[√] Android Studio (version 3.6)
[√] VS Code (version 1.46.1)
[√] Connected device (1 available)
! Doctor found issues in 1 category.
并接受所有许可。
谢谢。
最佳答案
考虑这两个:
1. 确保您打开了项目的根目录,而不是更高的文件夹。这样 .vscode
文件夹将在与 lib
文件夹相同的级别上创建。
2. 检查 lib/main.dart
是否存在。如果您的 main
函数不同,请编辑 launch.json
文件并更改程序。
关于flutter - 无法使用 VScode 和 Android Studio Emulator 启动我的 flutter 应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62700459/