debug dart hang in launching on vscode

Viewed 192

Reproduce:

  • run dart create projectname
  • open projectname on vscode and hit F5 to start debug

launching

Then vscode is launching debugger forever.

If stop debugger, it prompt timeout. timeout


If just run dart run, it will print hello world! as expected.

bin/projectname.dart genereated by dart create:

void main(List<String> arguments) {
  print('Hello world!');
}

Dart is installed within flutter. And flutter app cannot debug similarly, maybe related to this issue.

Dart and flutter extensions on vscode are installed. Nothing changed after re-installing them.

Some answers mention launch.json, but I never configure it and configuration should be default.

Result of flutter doctor -v:

[√] Flutter (Channel stable, 2.10.2, on Microsoft Windows [Version 10.0.19044.1566], locale zh-CN)
    • Flutter version 2.10.2 at D:\Program Files\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 097d3313d8 (12 days ago), 2022-02-18 19:33:08 -0600
    • Engine revision a83ed0e5e3
    • Dart version 2.16.1
    • DevTools version 2.9.2

[!] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at D:\ProgramData\Android\Sdk
    X cmdline-tools component is missing
      Run `path/to/sdkmanager --install "cmdline-tools;latest"`
      See https://developer.android.com/studio/command-line for more details.
    X Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/windows#android-setup for more details.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop for Windows (Visual Studio 生成工具 2019 16.11.10)
    • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools
    • Visual Studio 生成工具 2019 version 16.11.32126.315
    • Windows 10 SDK version 10.0.20348.0

[√] Android Studio (version 4.1)
    • Android Studio at D:\Program Files\Android\Android Studio
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)

[√] VS Code (version 1.64.2)
    • VS Code at C:\Users\[username]\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.36.0

[!] Proxy Configuration
    • HTTP_PROXY is set
    ! NO_PROXY is not set

[√] Connected device (3 available)
    • Windows (desktop) • windows • windows-x64    • Microsoft Windows [Version 10.0.19044.1566]
    • Chrome (web)      • chrome  • web-javascript • Google Chrome 98.0.4758.102
    • Edge (web)        • edge    • web-javascript • Microsoft Edge 98.0.1108.62

[√] HTTP Host Availability
    • All required HTTP hosts are available

! Doctor found issues in 2 categories.

Update:

0 Answers
Related