Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/flutter/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Flutter 无法使用VScode和Android Studio Emulator启动我的颤振应用程序_Flutter - Fatal编程技术网

Flutter 无法使用VScode和Android Studio Emulator启动我的颤振应用程序

Flutter 无法使用VScode和Android Studio Emulator启动我的颤振应用程序,flutter,Flutter,我无法启动我的颤振应用程序,这是我尝试使用debbug和不使用debbug模式运行时收到的消息: 您的启动配置引用了一个不存在的程序。如果在启动时遇到问题,请检查.vscode/launch.json文件中的程序字段 默认情况下,My.json文件: { // Use IntelliSense to learn about possible attributes. // Hover to view descriptions of existing attributes. // For

我无法启动我的颤振应用程序,这是我尝试使用debbug和不使用debbug模式运行时收到的消息:

您的启动配置引用了一个不存在的程序。如果在启动时遇到问题,请检查.vscode/launch.json文件中的程序字段

默认情况下,My.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"
    }
  ]
 
我运行颤振博士:

[!] 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.
并且接受了所有的许可证


谢谢。

删除launch.json文件,然后打开调试菜单并单击创建launch.json文件

从下拉列表中,选择dart和Flatter,然后再次运行应用程序

考虑以下两个方面:

一,。确保打开了项目的根目录,而不是更高的文件夹。因此,将在与lib文件夹相同的级别上创建.vscode文件夹

二,。检查lib/main.dart是否存在。如果主函数不同,请编辑launch.json文件并更改程序


如果您遇到此问题,请检查以下步骤 尝试从launch.json文件中为颤振应用程序中的main.dart文件提供一个完美的路径 例如

如果不起作用,则从终端类型

扑通 飞跑
确保配置程序路径与main.dart路径相同,或者与main方法相同

void main() {
  runApp(MyApp());
}

最好添加完整的路径,这对我很有用。这发生在我移动我的主服务器之后。dart文件从库到新文件夹小部件。一旦我给出了完整的路径,它就成功了

"configurations": [

    {
        "name": "exp_app",
        "request": "launch",
        "type": "dart",
        "program": "E:\\FLUTTER\\exp_app\\lib\\widgets\\main.dart"
    }
]
"configurations": [

    {
        "name": "exp_app",
        "request": "launch",
        "type": "dart",
        "program": "E:\\FLUTTER\\exp_app\\lib\\widgets\\main.dart"
    }
]