Warm tip: This article is reproduced from serverfault.com, please click

debugging-无法在VS Code中调试Flutter Dart代码,未验证断点错误

(debugging - Unable to debug flutter dart code in VS Code, Unverified Breakpoint error)

发布于 2020-06-04 18:42:14

文件结构当代码未运行时,我可以添加断点(红色圆圈),但是一旦进入调试模式,它就会变成未验证的断点(灰色空心圆圈),并且根本不起作用。但是,同一项目在其他系统上也能很好地工作。我不知道问题是什么或解决方案是什么。我已经尝试过多次重新安装flutter SDK,并在SOF和GitHub上进行了很多与此有关的链接,但是没有一个帮助足够。

环境-VS代码,Flutter版本:1.17.2

Flutter 医生-

[✓] Flutter (Channel stable, v1.17.2, on Mac OS X 10.15.3 19D76, locale en-GB)
[✗] Android toolchain - develop for Android devices
    ✗ Unable to locate Android SDK.
      Install Android Studio from: https://developer.android.com/studio/index.html
      On first launch it will assist you in installing the Android SDK components.
      (or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions).
      If the Android SDK has been installed to a custom location, set ANDROID_SDK_ROOT to that location.
      You may also want to add it to your PATH environment variable.

[✓] Xcode - develop for iOS and macOS (Xcode 11.3.1)
[!] Android Studio (not installed)
[✓] VS Code (version 1.45.1)
[✓] Connected device (1 available)

! Doctor found issues in 2 categories.

我的launch.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": "Flutter: Run all Tests",
            "type": "dart",
            "request": "launch",
            "program": "./test/"
        },
        {
            "name": "Dart: Run all Tests",
            "type": "dart",
            "request": "launch",
            "program": "./test/"
        },
        {
            "name": "Dart",
            "type": "dart",
            "request": "launch",
            "program": "bin/main.dart"
        },
    {
        "name": "Dart: Attach to Process",
        "type": "dart",
        "request": "attach"
    },
        {
            "name": "Flutter",
            "request": "launch",
            "type": "dart"
        }
    ]
}

另外,如果你知道VSCode和Flutter的Android Studio的任何替代方法,请分享。

Questioner
Robin
Viewed
11
Rodrigo porras 2020-12-12 03:42:00

我来自Mac,在Windows上始终使用fn + f5,这意味着不带调试就开始调试,这是我的错误。