Repository: Dart-Code/Dart-Code

Issue #4840: Unable to select devices or start debugging Flutter apps when with certain builds of "git" on PATH (msys2, devkitpro)
Created: 2023-11-15T12:32:12Z
Describe the bug
I can't debug my Flutter app using VSCode anymore. When I start VSCode, it shows 'No Device' in the bottom right corner and interacting with it does not give me any options for devices. Trying to run a debug session with F5 or by clicking 'Run and debug' creates a loop and the debugger never starts.
To Reproduce
I am unable to reproduce it since it is still occurring.
Workspace

Operating System and version: "Windows 10 Pro" 10.0 (Build 22631)
VS Code version: win 1.84.2
Dart extension version: 3.76.1
Flutter extension version: 3.76.0
Dart/Flutter SDK version: Dart (3.1.5) / Flutter (3.13.9)


Steps I Tried to Solve the Problem

Initializing the app through 'flutter run' (it works; the terminal gives me the correct options for available devices, but – as far as I know, at least – you can't do a step-by-step debug from it, only through IDEs).
Running 'flutter doctor' (everything is okay)
Creating a new project and attempting to debug it.
Disabling and, also, uninstalling all my extensions (leaving only Dart and Flutter extensions).
Uninstalling VSCode (and reinstalling after a reboot).
Uninstalling Flutter/Dart (and reinstalling after a reboot).
Uninstalling both VSCode and Flutter/Dart (and reinstalling after a reboot), also completely cleaning any residual files before reinstalling too.
Rolling back extensions to an older version (that I had used before).
Deleting and rebuilding the launch.json file (by using VSCode's default option to create a launch.json file).
Deleting my entire project and cloning it again using Git in another directory.
Creating a new project in another directory.



LOG flutter doctor -v
PS C:\Users\PcUser\Documents\Projects\FlutterApp> flutter doctor -v
[√] Flutter (Channel stable, 3.13.9, on Microsoft Windows [versÆo 10.0.22631.2506], locale pt-BR)
    • Flutter version 3.13.9 on channel stable at C:\Flutter\flutter
    • Upstream repository unknown source
    • FLUTTER_GIT_URL = unknown source
    • Framework revision d211f42860 (3 weeks ago), 2023-10-25 13:42:25 -0700
    • Engine revision 0545f8705d
    • Dart version 3.1.5
    • DevTools version 2.25.0

[√] Windows Version (Installed version of Windows is version 10 or higher)

[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at C:\Users\PcUser\AppData\Local\Android\Sdk
    • Platform android-34, build-tools 34.0.0
    • ANDROID_HOME = C:\Users\PcUser\AppData\Local\Android\Sdk
    • Java binary at: C:\Program Files\Android\Android Studio\jbr\bin\java
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-b2043.56-9586694)
    • All Android licenses accepted.

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

[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.6.3)
    • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
    • Visual Studio Community 2022 version 17.6.33801.468
    • Windows 10 SDK version 10.0.22000.0

[√] Android Studio (version 2022.2)
    • Android Studio at C:\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 17.0.6+0-b2043.56-9586694)

[√] VS Code (version 1.84.2)
    • VS Code at C:\Users\PcUser\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.70.0

[√] Connected device (3 available)
    • Windows (desktop) • windows • windows-x64    • Microsoft Windows [versÆo 10.0.22631.2506]
    • Chrome (web)      • chrome  • web-javascript • Google Chrome 119.0.6045.124
    • Edge (web)        • edge    • web-javascript • Microsoft Edge 119.0.2151.58

[√] Network resources
    • All expected network resources are available.

• No issues found!


Edit: The 'Returning cached promise for getSupportedPlatforms()' lines are me clicking the 'No Device' button in the bottom right corner of VSCode. After that I try running the debugger with F5 and then by clicking 'Run and Debug'

Dart Capture LOG 1 (About a minute) - Older versions of extensions
Dart Code extension: 3.70.0
Flutter extension: 3.70.0 (activated)

App: Visual Studio Code
Version: 1.84.2
Platform: win

Workspace type: Flutter
Analyzer type: LSP
Multi-root?: false

Dart SDK:
    Loc: C:\Flutter\flutter\bin\cache\dart-sdk
    Ver: 3.1.5
Flutter SDK:
    Loc: C:\Flutter\flutter
    Ver: 3.13.9

HTTP_PROXY: undefined
NO_PROXY: undefined

Logging Categories:
    General, CommandProcesses, DartTest, DAP, VmService, DevTools, FlutterDaemon, FlutterRun, FlutterTest, WebDaemon

Wed Nov 15 2023 Log file started
[8:51:48 AM] [General] [Info] Returning cached results for project search
[8:51:50 AM] [General] [Info] Returning cached results for project search
[8:51:50 AM] [General] [Info] Checking 1 projects for supported platforms
[8:51:50 AM] [FlutterDaemon] [Info] ==> [{"id":"3","method":"daemon.getSupportedPlatforms","params":{"projectRoot":"C:\\Users\\PcUser\\Documents\\Projects\\FlutterApp"}}]
[8:51:50 AM] [General] [Info] Returning cached promise for getSupportedPlatforms()
[8:51:51 AM] [General] [Info] Returning cached promise for getSupportedPlatforms()
[8:51:51 AM] [General] [Info] Returning cached promise for getSupportedPlatforms()
[8:51:51 AM] [General] [Info] Returning cached promise for getSupportedPlatforms()
[8:51:51 AM] [General] [Info] Returning cached promise for getSupportedPlatforms()
[8:51:51 AM] [General] [Info] Returning cached promise for getSupportedPlatforms()
[8:51:52 AM] [General] [Info] Returning cached promise for getSupportedPlatforms()
[8:51:52 AM] [General] [Info] Returning cached promise for getSupportedPlatforms()
[8:51:53 AM] [General] [Info] Returning cached promise for getSupportedPlatforms()
[8:51:54 AM] [General] [Info] Returning cached promise for getSupportedPlatforms()
[8:51:55 AM] [General] [Info] Returning cached promise for getSupportedPlatforms()
[8:51:56 AM] [General] [Info] Returning cached promise for getSupportedPlatforms()
[8:51:57 AM] [General] [Info] Returning cached promise for getSupportedPlatforms()
[8:52:04 AM] [General] [Info] Starting debug session...
[8:52:04 AM] [General] [Info]     workspace: C:\\Users\\PcUser\\Documents\\Projects\\FlutterApp
[8:52:04 AM] [General] [Info] Setting cwd based on likely entry point: C:\\Users\\<PcUser>\\Documents\\<Projects>\\<FlutterApp>
[8:52:04 AM] [General] [Info] Using open file as entry point: C:\\Users\\PcUser\\Documents\\Projects\\FlutterApp\\lib\\main.dart
[8:52:04 AM] [General] [Info] Using workspace as cwd: C:\\Users\\<PcUser>\\Documents\\<Projects>\\<FlutterApp>
[8:52:04 AM] [General] [Info] Detected launch project as Flutter
[8:52:04 AM] [General] [Info] Using Flutter debug adapter for this session
[8:52:04 AM] [FlutterDaemon] [Info] ==> [{"id":"4","method":"daemon.getSupportedPlatforms","params":{"projectRoot":"C:\\Users\\PcUser\\Documents\\Projects\\FlutterApp"}}]
[8:52:09 AM] [General] [Info] Returning cached promise for getSupportedPlatforms()
Wed Nov 15 2023 Log file ended



Dart Capture LOG 2 (About a minute) - Latest versions of extensions
Dart Code extension: 3.76.1
Flutter extension: 3.76.0 (activated)

App: Visual Studio Code
App Host: desktop
Version: win 1.84.2

Workspace type: Flutter (LSP)

Dart (3.1.5): C:\Flutter\flutter\bin\cache\dart-sdk
Flutter (3.13.9): C:\Flutter\flutter (No device)


Logging Categories:
    General, CommandProcesses, DartTest, DAP, VmService, DevTools, FlutterDaemon, FlutterRun, FlutterTest, WebDaemon

Wed Nov 15 2023 [09:01:57 GMT-0300 (Brasilia Standard Time)] Log file started
[9:02:00 AM] [General] [Info] Returning cached results for project search
[9:02:00 AM] [General] [Info] Checking 1 projects for supported platforms
[9:02:00 AM] [FlutterDaemon] [Info] ==> [{"id":"3","method":"daemon.getSupportedPlatforms","params":{"projectRoot":"C:\\Users\\PcUser\\Documents\\Projects\\FlutterApp"}}]
[9:02:05 AM] [General] [Info] Returning cached promise for getSupportedPlatforms()
[9:02:09 AM] [General] [Info] Returning cached promise for getSupportedPlatforms()
[9:02:11 AM] [General] [Info] Returning cached promise for getSupportedPlatforms()
[9:02:14 AM] [General] [Info] Starting debug session...
[9:02:14 AM] [General] [Info]     workspace: C:\Users\PcUser\Documents\Projects\FlutterApp
[9:02:14 AM] [General] [Info] Setting cwd based on likely entry point: C:\Users\PcUser\Documents\Projects\FlutterApp
[9:02:14 AM] [General] [Info] Using open file as entry point: C:\Users\PcUser\Documents\Projects\FlutterApp\lib\main.dart
[9:02:14 AM] [General] [Info] Using workspace as cwd: C:\Users\PcUser\Documents\Projects\FlutterApp
[9:02:14 AM] [General] [Info] Detected launch project as Flutter
[9:02:14 AM] [General] [Info] Using Flutter debug adapter for this session
[9:02:14 AM] [FlutterDaemon] [Info] ==> [{"id":"4","method":"daemon.getSupportedPlatforms","params":{"projectRoot":"C:\\Users\\PcUser\\Documents\\Projects\\FlutterApp"}}]
[9:02:19 AM] [General] [Info] Returning cached promise for getSupportedPlatforms()
[9:02:34 AM] [General] [Info] Starting debug session...
[9:02:34 AM] [General] [Info]     workspace: C:\Users\PcUser\Documents\Projects\FlutterApp
[9:02:34 AM] [General] [Info] Setting cwd based on likely entry point: C:\Users\PcUser\Documents\Projects\FlutterApp
[9:02:34 AM] [General] [Info] Using open file as entry point: C:\Users\PcUser\Documents\Projects\FlutterApp\lib\main.dart
[9:02:34 AM] [General] [Info] Using workspace as cwd: C:\Users\PcUser\Documents\Projects\FlutterApp
[9:02:34 AM] [General] [Info] Detected launch project as Flutter
[9:02:34 AM] [General] [Info] Using Flutter debug adapter for this session
[9:02:34 AM] [FlutterDaemon] [Info] ==> [{"id":"5","method":"daemon.getSupportedPlatforms","params":{"projectRoot":"C:\\Users\\PcUser\\Documents\\Projects\\FlutterApp"}}]
[9:02:39 AM] [General] [Info] Returning cached promise for getSupportedPlatforms()
Wed Nov 15 2023 [09:03:31 GMT-0300 (Brasilia Standard Time)] Log file ended

Duplicate issue #5050: VSCode stuck in Select a device to use
Created: 2024-03-27T21:07:13Z
Describe the bug
When pressing the "No Device" button, the popup states "select a device to use" with a loading bar below it. I am unable to select a device.
To Reproduce

Create a new project
Click on 'No Device'

Expected behavior
A selection menu to select the android emulator.
Screenshots

Please complete the following information:
You can run the Dart: Collect Diagnostic Information command from the VS Code command palette (F1) to easily capture this information or provide it manually.

Workspace Environment
Dart Code extension: 3.84.0
Flutter extension: 3.84.0 (activated)

App: Visual Studio Code
App Host: desktop
Version: win 1.86.1

Workspace type: Flutter (LSP)

Dart (3.3.2): C:\Users\USER\Desktop\flutter\flutter\bin\cache\dart-sdk
Flutter (3.19.4): C:\Users\USER\Desktop\flutter\flutter (No device)




Output from 'dart info'
C:\Users\USER\Desktop\flutter\flutter\bin\cache\dart-sdk\bin\dart.exe info
If providing this information as part of reporting a bug, please review the information
below to ensure it only contains things you're comfortable posting publicly.
General info

Dart 3.3.2 (stable) (Tue Mar 19 20:44:48 2024 +0000) on "windows_x64"
on windows / "Windows 10 Pro" 10.0 (Build 22631)
locale is en-US

Project info

sdk constraint: '>=3.3.2 <4.0.0'
dependencies: flutter
dev_dependencies: flutter_lints, flutter_test

Process info



Memory
CPU
Elapsed time
Command line




371 MB
--

dart.exe


96 MB
--

dart.exe


84 MB
--

dart.exe


96 MB
--

dart.exe





Output from 'flutter doctor'
C:\Users\USER\Desktop\flutter\flutter\bin\flutter.bat doctor -v
[!] Flutter (Channel stable, 3.19.4, on Microsoft Windows [Version 10.0.22631.3007], locale en-US)
    • Flutter version 3.19.4 on channel stable at C:\Users\USER\Desktop\flutter\flutter
    ! Upstream repository unknown source is not a standard remote.
      Set environment variable "FLUTTER_GIT_URL" to unknown source to dismiss this error.
    • Framework revision 68bfaea224 (7 days ago), 2024-03-20 15:36:31 -0700
    • Engine revision a5c24f538d
    • Dart version 3.3.2
    • DevTools version 2.31.1
    • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.

[√] Windows Version (Installed version of Windows is version 10 or higher)

[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at C:\Users\USER\AppData\Local\Android\sdk
    • Platform android-34, build-tools 34.0.0
    • Java binary at: C:\Program Files\Android\Android Studio\jbr\bin\java
    • Java version OpenJDK Runtime Environment (build 17.0.7+0-b2043.56-10550314)
    • All Android licenses accepted.

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

[!] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.8.3)
    • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
    • Visual Studio Community 2022 version 17.8.34330.188
    X Visual Studio is missing necessary components. Please re-run the Visual Studio installer for the "Desktop development with C++" workload, and include these components:
        MSVC v142 - VS 2019 C++ x64/x86 build tools
         - If there are multiple build tool versions available, install the latest
        C++ CMake tools for Windows
        Windows 10 SDK

[√] Android Studio (version 2023.1)
    • Android Studio at C:\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 17.0.7+0-b2043.56-10550314)

[√] IntelliJ IDEA Community Edition (version 2022.1)
    • IntelliJ at C:\Users\USER\AppData\Local\JetBrains\Toolbox\apps\IDEA-C\ch-0\221.5921.22
    • 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

[√] IntelliJ IDEA Community Edition (version 2022.2)
    • IntelliJ at C:\Users\USER\AppData\Local\JetBrains\Toolbox\apps\IDEA-C\ch-0\222.3345.118
    • 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

[√] VS Code (version 1.86.1)
    • VS Code at C:\Users\USER\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.84.0

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

[√] Network resources
    • All expected network resources are available.

! Doctor found issues in 2 categories.

Closing comment (2024-05-22T18:55:38Z): Thanks for confirming. I guess devkitpro's version of Git has the same problem as the msys2 version.
I'll close this as a dupe of #4840 / flutter/flutter#143625. Thanks!