Skip to content

Launching a new app in VSCode fails quickly with no error in VS Code insiders #5183

Closed

Description

@natebot13

Describe the bug
Attempting to launch either an old app or a freshly generated new app using VSCode's "Run" option briefly shows the debugger controls, then stops. I've checked extension outputs and vscode's developer console for errors, but nothing reveals any insight. When running from command line with "flutter run", the app launches successfully.

To Reproduce

  1. Start with a clean checkout of flutter stable (version and system info below)
  2. Generate a fresh app
  3. Use VSCode to try running it
  4. Observe it doesn't launch

Hints
I've found that adding the setting "dart.useLegacyDebugAdapters": true to my project allows it to be successfully launched by vscode. I assume it's related to something failing with using the non-legacy debug adapter. If I could find some logs for that, I'm sure the issue might be clearer.

Workspace Environment
Dart Code extension: 3.92.0
Flutter extension: 3.93.20240702 (activated)

App: Visual Studio Code - Insiders
App Host: desktop
Version: win 1.92.0-insider

Workspace type: Flutter (LSP)

Dart (3.4.3): C:\src\flutter\bin\cache\dart-sdk
Flutter (3.22.2): C:\src\flutter (Windows (windows-x64/windows))

Output from 'dart info'

C:\src\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.4.3 (stable) (Tue Jun 4 19:51:39 2024 +0000) on "windows_x64"
  • on windows / "Windows 10 Pro" 10.0 (Build 22635)
  • locale is en-US

Project info

  • sdk constraint: '>=2.15.0 <3.0.0'
  • dependencies: bloc, flutter, flutter_bloc, flutter_highlight, flutter_localizations, google_fonts, highlighter, intl, json_annotation, protobuf, rive
  • dev_dependencies: build_runner, flutter_test, json_serializable, pedantic, protoc_builder

Process info

Memory CPU Elapsed time Command line
111 MB -- dart.exe
626 MB -- dart.exe
103 MB -- dart.exe
103 MB -- dart.exe
95 MB -- dart.exe
Output from 'flutter doctor'

C:\src\flutter\bin\flutter.bat doctor -v

[√] Flutter (Channel stable, 3.22.2, on Microsoft Windows [Version 10.0.22635.3930], locale en-US)
    • Flutter version 3.22.2 on channel stable at C:\src\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 761747bfc5 (6 weeks ago), 2024-06-05 22:15:13 +0200
    • Engine revision edd8546116
    • Dart version 3.4.3
    • DevTools version 2.34.3

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

[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0-rc3)
    • Android SDK at C:\Users\tekkb\AppData\Local\Android\sdk
    • Platform android-34, build-tools 34.0.0-rc3
    • Java binary at: C:\Program Files\Android\Android Studio\jbr\bin\java
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-b2043.56-10027231)
    • 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.4.4)
    • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
    • Visual Studio Community 2022 version 17.4.33213.308
    • Windows 10 SDK version 10.0.19041.0

[√] Android Studio (version 2022.3)
    • 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-10027231)

[√] IntelliJ IDEA Community Edition (version 2023.1)
    • IntelliJ at C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2023.1
    • 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.92.0-insider)
    • VS Code at C:\Users\tekkb\AppData\Local\Programs\Microsoft VS Code Insiders
    • Flutter extension version 3.92.0

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

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

• No issues found!

Activity

  1. DanTup commented on Jul 16, 2024

    @DanTup
    Member

    Not showing an error might be fixed by flutter/flutter#149734 which is in the Flutter master channel but has not made a release yet. For some kinds of failures, the error message would not make it back to the client properly.

    One thing you can try:

    • Run the Dart: Capture Debugging Logs command from the command palette (F1)
    • Try to launch the app and wait for the debug session to end
    • Click the Cancel button on the logging notification to stop logging and open the log file
    • Remove anything sensitive from the log and post it here
  2. added
    awaiting infoRequires more information from the customer to progress
    on Jul 16, 2024
  3. nulkode commented on Jul 29, 2024

    @nulkode

    I can confirm I'm having this issue as well. It was also resolved temporarily with "dart.useLegacyDebugAdapters": true.

    Workspace Environment
    Dart Code extension: v3.92.0 (release version)
    Flutter extension: v3.92.0 (release version)
    
    App: Visual Studio Code - Insiders
    App Host: desktop
    Version: win 1.92.0-insider
    
    Workspace type: Flutter
    
    Output from 'dart info'

    General info

    • Dart 3.4.4 (stable) (Wed Jun 12 15:54:31 2024 +0000) on "windows_x64"
    • on windows / "Windows 10 Pro" 10.0 (Build 22631)
    • locale is es-ES

    Project info

    • sdk constraint: '>=3.2.6 <4.0.0'
    • dependencies: flutter, flutter_riverpod, flutter_svg, freezed_annotation, go_router, google_fonts, json_annotation, logger, relative_time, riverpod_annotation
    • dev_dependencies: build_runner, custom_lint, flutter_lints, flutter_test, freezed, json_serializable, riverpod_generator, riverpod_lint

    Process info

    Memory CPU Elapsed time Command line
    0 MB -- dart.exe
    0 MB -- dart.exe
    0 MB -- dart.exe
    0 MB -- dart.exe
    0 MB -- dart.exe
    0 MB -- dart.exe
    Output from 'flutter doctor'
    [√] Flutter (Channel stable, 3.22.3, on Microsoft Windows [Versi¢n 10.0.22631.3880], locale es-ES)
        • Flutter version 3.22.3 on channel stable at A:\software\flutter
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision b0850beeb2 (12 days ago), 2024-07-16 21:43:41 -0700
        • Engine revision 235db911ba
        • Dart version 3.4.4
        • DevTools version 2.34.3
    
    [√] 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\nulko\AppData\Local\Android\sdk
        • Platform android-34, build-tools 34.0.0
        • Java binary at: C:\Users\nulko\AppData\Local\Programs\Android Studio\jbr\bin\java
        • Java version OpenJDK Runtime Environment (build 17.0.11+0--11852314)
        • All Android licenses accepted.
    
    [√] Chrome - develop for the web
        • CHROME_EXECUTABLE = C:\Users\nulko\AppData\Local\Chromium\Application\chrome.exe
    
    [√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.5.4)
        • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
        • Visual Studio Community 2022 version 17.5.33530.505
        • Windows 10 SDK version 10.0.22000.0
    
    [!] Android Studio (version 2022.1) [not in use]
        • 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
        X Unable to determine bundled Java version.
        • Try updating or re-installing Android Studio.
    
    [√] Android Studio (version 2024.1)
        • Android Studio at C:\Users\nulko\AppData\Local\Programs\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.11+0--11852314)
    
    [√] IntelliJ IDEA Community Edition (version 2023.3)
        • IntelliJ at C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2023.3.6
        • 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.91.1) [not in use]
        • VS Code at C:\Users\nulko\AppData\Local\Programs\Microsoft VS Code
        • Flutter extension can be installed from:
           https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter
    
    [√] VS Code (version 1.92.0-insider)
        • VS Code at C:\Users\nulko\AppData\Local\Programs\Microsoft VS Code Insiders
        • Flutter extension version 3.92.0
    
    [√] Connected device (4 available)
        • sdk gphone16k x86 64 (mobile) • emulator-5554 • android-x64    • Android 15 (API 35) (emulator) [using this one]
        • Windows (desktop)             • windows       • windows-x64    • Microsoft Windows [Versi¢n 10.0.22631.3880]
        • Chrome (web)                  • chrome        • web-javascript • unknown
        • Edge (web)                    • edge          • web-javascript • Microsoft Edge 126.0.2592.61
    
    [√] Network resources
        • All expected network resources are available.
    

    Here is the output from the debugging log capture session started before starting debugging my app and stopping it right after it fails.

    Dart Code extension: 3.92.0
    Flutter extension: 3.92.0 (activated)
    
    App: Visual Studio Code - Insiders
    App Host: desktop
    Version: win 1.92.0-insider
    
    Workspace type: Flutter (LSP)
    
    Dart (3.4.4): A:\software\flutter\bin\cache\dart-sdk
    Flutter (3.22.3): A:\software\flutter (No device)
    
    
    Logging Categories:
        General, AnalyzerTiming, CommandProcesses, DartTest, DartToolingDaemon, DAP, VmService, DevTools, FlutterDaemon, FlutterRun, FlutterTest, WebDaemon
    
    Mon Jul 29 2024 [12:43:48 GMT+0200 (Central European Summer Time)] Log file started
    [12:43:51 PM] [General] [Info] Starting debug session...
    [12:43:51 PM] [General] [Info]     workspace: A:\code\Flutter\myapp
    [12:43:51 PM] [General] [Info] Setting cwd based on likely entry point: A:\code\Flutter\myapp
    [12:43:51 PM] [General] [Info] Using found common entry point: A:\code\Flutter\myapp\lib\main.dart
    [12:43:51 PM] [General] [Info] Using workspace as cwd: A:\code\Flutter\myapp
    [12:43:51 PM] [General] [Info] Detected launch project as Flutter
    [12:43:51 PM] [General] [Info] Using Flutter debug adapter for this session
    [12:43:51 PM] [FlutterDaemon] [Info] ==> [{"id":"4","method":"daemon.getSupportedPlatforms","params":{"projectRoot":"A:\\code\\Flutter\\myapp"}}]
    [12:43:51 PM] [FlutterDaemon] [Info] <== [{"id":"4","result":{"platforms":["android","ios"],"platformTypes":{"web":{"isSupported":false,"reasons":[{"reasonText":"the Web platform is not enabled for this project","fixText":"Run \"flutter create --platforms=web .\" in your application directory","fixCode":"create"}]},"android":{"isSupported":true},"ios":{"isSupported":true},"linux":{"isSupported":false,"reasons":[{"reasonText":"the Linux platform is not enabled for this project","fixText":"Run \"flutter create --platforms=linux .\" in your application directory","fixCode":"create"}]},"macos":{"isSupported":false,"reasons":[{"reasonText":"the macOS platform is not enabled for this project","fixText":"Run \"flutter create --platforms=macos .\" in your application directory","fixCode":"create"}]},"windows":{"isSupported":false,"reasons":[{"reasonText":"the Windows platform is not enabled for this project","fixText":"Run \"flutter create --platforms=windows .\" in your application directory","fixCode":"create"}]},"fuchsia":{"isSupported":false,"reasons":[{"reasonText":"the Fuchsia feature is not enabled","fixText":"Run \"flutter config --enable-fuchsia\"","fixCode":"config"},{"reasonText":"the Fuchsia platform is not enabled for this project","fixText":"Run \"flutter create --platforms=fuchsia .\" in your application directory","fixCode":"create"}]},"custom":{"isSupported":false,"reasons":[{"reasonText":"the custom devices feature is not enabled","fixText":"Run \"flutter config --enable-custom-devices\"","fixCode":"config"}]},"windowsPreview":{"isSupported":false,"reasons":[{"reasonText":"the Preview Device feature is not enabled","fixText":"Run \"flutter config --enable-flutter-preview","fixCode":"config"},{"reasonText":"the Windows platform is not enabled for this project","fixText":"Run \"flutter create --platforms=windows .\" in your application directory","fixCode":"create"}]}}}}]
    [12:43:51 PM] [FlutterDaemon] [Info] ==> [{"id":"5","method":"daemon.getSupportedPlatforms","params":{"projectRoot":"A:\\code\\Flutter\\myapp"}}]
    [12:43:51 PM] [FlutterDaemon] [Info] <== [{"id":"5","result":{"platforms":["android","ios"],"platformTypes":{"web":{"isSupported":false,"reasons":[{"reasonText":"the Web platform is not enabled for this project","fixText":"Run \"flutter create --platforms=web .\" in your application directory","fixCode":"create"}]},"android":{"isSupported":true},"ios":{"isSupported":true},"linux":{"isSupported":false,"reasons":[{"reasonText":"the Linux platform is not enabled for this project","fixText":"Run \"flutter create --platforms=linux .\" in your application directory","fixCode":"create"}]},"macos":{"isSupported":false,"reasons":[{"reasonText":"the macOS platform is not enabled for this project","fixText":"Run \"flutter create --platforms=macos .\" in your application directory","fixCode":"create"}]},"windows":{"isSupported":false,"reasons":[{"reasonText":"the Windows platform is not enabled for this project","fixText":"Run \"flutter create --platforms=windows .\" in your application directory","fixCode":"create"}]},"fuchsia":{"isSupported":false,"reasons":[{"reasonText":"the Fuchsia feature is not enabled","fixText":"Run \"flutter config --enable-fuchsia\"","fixCode":"config"},{"reasonText":"the Fuchsia platform is not enabled for this project","fixText":"Run \"flutter create --platforms=fuchsia .\" in your application directory","fixCode":"create"}]},"custom":{"isSupported":false,"reasons":[{"reasonText":"the custom devices feature is not enabled","fixText":"Run \"flutter config --enable-custom-devices\"","fixCode":"config"}]},"windowsPreview":{"isSupported":false,"reasons":[{"reasonText":"the Preview Device feature is not enabled","fixText":"Run \"flutter config --enable-flutter-preview","fixCode":"config"},{"reasonText":"the Windows platform is not enabled for this project","fixText":"Run \"flutter create --platforms=windows .\" in your application directory","fixCode":"create"}]}}}}]
    [12:43:51 PM] [General] [Info] Getting DevTools server address to pass to Flutter...
    [12:43:51 PM] [General] [Info] Checking for errors before launching
    [12:43:51 PM] [General] [Info] Debug session starting...
        {
            "dartCodeDebugSessionID": "session-55bf0",
            "type": "dart",
            "request": "launch",
            "program": "A:\\code\\Flutter\\myapp\\lib\\main.dart",
            "projectRootPath": "A:\\code\\Flutter\\myapp",
            "cwd": "A:\\code\\Flutter\\myapp",
            "name": "Flutter (Pixel 7a API 35)",
            "deviceId": "emulator-5554",
            "deviceName": "Pixel 7a API 35 (android-x64)",
            "toolEnv": {
                "FLUTTER_HOST": "VSCode",
                "PUB_ENVIRONMENT": "vscode.dart-code",
                "FLUTTER_ROOT": "A:\\software\\flutter"
            },
            "sendLogsToClient": true,
            "sendCustomProgressEvents": true,
            "allowAnsiColorOutput": true,
            "additionalProjectPaths": [
                "A:\\code\\Flutter\\myapp"
            ],
            "args": [],
            "vmAdditionalArgs": [],
            "toolArgs": [
                "-d",
                "emulator-5554",
                "--devtools-server-address",
                "http://127.0.0.1:9100/",
                "-v"
            ],
            "vmServicePort": 0,
            "dartSdkPath": "A:\\software\\flutter\\bin\\cache\\dart-sdk",
            "maxLogLineLength": 2000,
            "debugSdkLibraries": false,
            "debugExternalPackageLibraries": false,
            "showDartDeveloperLogs": true,
            "evaluateGettersInDebugViews": true,
            "showGettersInDebugViews": true,
            "evaluateToStringInDebugViews": true,
            "flutterSdkPath": "A:\\software\\flutter",
            "useInspectorNotificationsForWidgetErrors": true,
            "showMemoryUsage": false,
            "debuggerType": 2
        }
    [12:43:51 PM] [General] [Info] Using flutter debugger for Flutter
    [12:43:51 PM] [General] [Info] SDK DAP setting is true, set by sdkDaps experiment
    [12:43:51 PM] [General] [Info] Running SDK DAP Dart VM in undefined: A:\software\flutter\bin\flutter.bat debug_adapter and options {"env":{"FLUTTER_HOST":"VSCode","PUB_ENVIRONMENT":"vscode.dart-code","FLUTTER_ROOT":"A:\\software\\flutter"}}
    [12:43:51 PM] [DAP] [Info] Starting debug session 5ecef478-128a-41f2-8851-199a2d169c50
    [12:43:51 PM] [DAP] [Info] Debug session 5ecef478-128a-41f2-8851-199a2d169c50 errored: {"errno":-4071,"code":"EINVAL","syscall":"spawn"}
    [12:43:51 PM] [DAP] [Info] ==> {"command":"disconnect","arguments":{"restart":false},"type":"request","seq":1}
    [12:43:51 PM] [DAP] [Info] ==> {"command":"initialize","arguments":{"clientID":"vscode","clientName":"Visual Studio Code - Insiders","adapterID":"dart","pathFormat":"path","linesStartAt1":true,"columnsStartAt1":true,"supportsVariableType":true,"supportsVariablePaging":true,"supportsRunInTerminalRequest":true,"locale":"en","supportsProgressReporting":true,"supportsInvalidatedEvent":true,"supportsMemoryReferences":true,"supportsArgsCanBeInterpretedByShell":true,"supportsMemoryEvent":true,"supportsStartDebuggingRequest":true},"type":"request","seq":2}
    [12:43:51 PM] [DAP] [Info] Stopping debug session 5ecef478-128a-41f2-8851-199a2d169c50
    [12:43:53 PM] [General] [Info] Returning cached results for project search
    Mon Jul 29 2024 [12:43:54 GMT+0200 (Central European Summer Time)] Log file ended
    
  4. DanTup commented on Jul 29, 2024

    @DanTup
    Member

    @nulkode are you able to test against the current Flutter beta channel to see if the fix mentioned above resolved this?

  5. nulkode commented on Jul 29, 2024

    @nulkode

    @DanTup still doesn't work. I think the issue may be caused by Visual Studio Code - Insiders, as debugging in regular Visual Studio Code with the same extension version doesn't produce this bug.

    Debugging log capture session
    Dart Code extension: 3.92.0
    Flutter extension: 3.92.0 (activated)
    
    App: Visual Studio Code - Insiders
    App Host: desktop
    Version: win 1.92.0-insider
    
    Workspace type: Flutter (LSP)
    
    Dart (3.5.0-323.1.beta): A:\software\flutter\bin\cache\dart-sdk
    Flutter (3.24.0-0.1.pre): A:\software\flutter (No device)
    
    
    Logging Categories:
        General, AnalyzerTiming, CommandProcesses, DartTest, DartToolingDaemon, DAP, VmService, DevTools, FlutterDaemon, FlutterRun, FlutterTest, WebDaemon
    
    Mon Jul 29 2024 [14:18:23 GMT+0200 (Central European Summer Time)] Log file started
    [2:18:24 PM] [General] [Info] Starting debug session...
    [2:18:24 PM] [General] [Info]     workspace: A:\code\Flutter\myapp
    [2:18:24 PM] [General] [Info] Setting cwd based on likely entry point: A:\code\Flutter\myapp
    [2:18:24 PM] [General] [Info] Using found common entry point: A:\code\Flutter\myapp\lib\main.dart
    [2:18:24 PM] [General] [Info] Using workspace as cwd: A:\code\Flutter\myapp
    [2:18:24 PM] [General] [Info] Detected launch project as Flutter
    [2:18:24 PM] [General] [Info] Using Flutter debug adapter for this session
    [2:18:24 PM] [FlutterDaemon] [Info] ==> [{"id":"11","method":"daemon.getSupportedPlatforms","params":{"projectRoot":"A:\\code\\Flutter\\myapp"}}]
    [2:18:24 PM] [FlutterDaemon] [Info] <== [{"id":"11","result":{"platforms":["android","ios"],"platformTypes":{"web":{"isSupported":false,"reasons":[{"reasonText":"the Web platform is not enabled for this project","fixText":"Run \"flutter create --platforms=web .\" in your application directory","fixCode":"create"}]},"android":{"isSupported":true},"ios":{"isSupported":true},"linux":{"isSupported":false,"reasons":[{"reasonText":"the Linux platform is not enabled for this project","fixText":"Run \"flutter create --platforms=linux .\" in your application directory","fixCode":"create"}]},"macos":{"isSupported":false,"reasons":[{"reasonText":"the macOS platform is not enabled for this project","fixText":"Run \"flutter create --platforms=macos .\" in your application directory","fixCode":"create"}]},"windows":{"isSupported":false,"reasons":[{"reasonText":"the Windows platform is not enabled for this project","fixText":"Run \"flutter create --platforms=windows .\" in your application directory","fixCode":"create"}]},"fuchsia":{"isSupported":false,"reasons":[{"reasonText":"the Fuchsia feature is not enabled","fixText":"Run \"flutter config --enable-fuchsia\"","fixCode":"config"},{"reasonText":"the Fuchsia platform is not enabled for this project","fixText":"Run \"flutter create --platforms=fuchsia .\" in your application directory","fixCode":"create"}]},"custom":{"isSupported":false,"reasons":[{"reasonText":"the custom devices feature is not enabled","fixText":"Run \"flutter config --enable-custom-devices\"","fixCode":"config"}]},"windowsPreview":{"isSupported":false,"reasons":[{"reasonText":"the Preview Device feature is not enabled","fixText":"Run \"flutter config --enable-flutter-preview","fixCode":"config"},{"reasonText":"the Windows platform is not enabled for this project","fixText":"Run \"flutter create --platforms=windows .\" in your application directory","fixCode":"create"}]}}}}]
    [2:18:24 PM] [FlutterDaemon] [Info] ==> [{"id":"12","method":"emulator.getEmulators"}]
    [2:18:24 PM] [FlutterDaemon] [Info] <== [{"id":"12","result":[{"id":"Pixel_7a_API_35","name":"Pixel 7a API 35","category":"mobile","platformType":"android"}]}]
    [2:18:25 PM] [General] [Info] Returning cached results for project search
    [2:18:25 PM] [FlutterDaemon] [Info] ==> [{"id":"13","method":"emulator.launch","params":{"emulatorId":"Pixel_7a_API_35","coldBoot":false}}]
    [2:18:25 PM] [General] [Info] Checking 1 projects for supported platforms
    [2:18:25 PM] [FlutterDaemon] [Info] ==> [{"id":"14","method":"daemon.getSupportedPlatforms","params":{"projectRoot":"A:\\code\\Flutter\\myapp"}}]
    [2:18:25 PM] [FlutterDaemon] [Info] <== [{"id":"14","result":{"platforms":["android","ios"],"platformTypes":{"web":{"isSupported":false,"reasons":[{"reasonText":"the Web platform is not enabled for this project","fixText":"Run \"flutter create --platforms=web .\" in your application directory","fixCode":"create"}]},"android":{"isSupported":true},"ios":{"isSupported":true},"linux":{"isSupported":false,"reasons":[{"reasonText":"the Linux platform is not enabled for this project","fixText":"Run \"flutter create --platforms=linux .\" in your application directory","fixCode":"create"}]},"macos":{"isSupported":false,"reasons":[{"reasonText":"the macOS platform is not enabled for this project","fixText":"Run \"flutter create --platforms=macos .\" in your application directory","fixCode":"create"}]},"windows":{"isSupported":false,"reasons":[{"reasonText":"the Windows platform is not enabled for this project","fixText":"Run \"flutter create --platforms=windows .\" in your application directory","fixCode":"create"}]},"fuchsia":{"isSupported":false,"reasons":[{"reasonText":"the Fuchsia feature is not enabled","fixText":"Run \"flutter config --enable-fuchsia\"","fixCode":"config"},{"reasonText":"the Fuchsia platform is not enabled for this project","fixText":"Run \"flutter create --platforms=fuchsia .\" in your application directory","fixCode":"create"}]},"custom":{"isSupported":false,"reasons":[{"reasonText":"the custom devices feature is not enabled","fixText":"Run \"flutter config --enable-custom-devices\"","fixCode":"config"}]},"windowsPreview":{"isSupported":false,"reasons":[{"reasonText":"the Preview Device feature is not enabled","fixText":"Run \"flutter config --enable-flutter-preview","fixCode":"config"},{"reasonText":"the Windows platform is not enabled for this project","fixText":"Run \"flutter create --platforms=windows .\" in your application directory","fixCode":"create"}]}}}}]
    [2:18:25 PM] [General] [Info] Supported platforms for the workspace are android, ios
    [2:18:28 PM] [FlutterDaemon] [Info] <== [{"id":"13"}]
    [2:18:36 PM] [FlutterDaemon] [Info] <== [{"event":"device.added","params":{"id":"emulator-5554","name":"sdk gphone16k x86 64","platform":"android-x64","emulator":true,"category":"mobile","platformType":"android","ephemeral":true,"emulatorId":"Pixel_7a_API_35","sdk":"Android 15 (API 35)","isConnected":true,"connectionInterface":"attached","capabilities":{"hotReload":true,"hotRestart":true,"screenshot":true,"fastStart":true,"flutterExit":true,"hardwareRendering":true,"startPaused":true}}}]
    [2:18:36 PM] [General] [Info] Saving emulator-5554 as preferred device
    [2:18:36 PM] [General] [Info] Returning cached results for project search
    [2:18:36 PM] [General] [Info] Checking 1 projects for supported platforms
    [2:18:36 PM] [FlutterDaemon] [Info] ==> [{"id":"15","method":"daemon.getSupportedPlatforms","params":{"projectRoot":"A:\\code\\Flutter\\myapp"}}]
    [2:18:36 PM] [FlutterDaemon] [Info] <== [{"id":"15","result":{"platforms":["android","ios"],"platformTypes":{"web":{"isSupported":false,"reasons":[{"reasonText":"the Web platform is not enabled for this project","fixText":"Run \"flutter create --platforms=web .\" in your application directory","fixCode":"create"}]},"android":{"isSupported":true},"ios":{"isSupported":true},"linux":{"isSupported":false,"reasons":[{"reasonText":"the Linux platform is not enabled for this project","fixText":"Run \"flutter create --platforms=linux .\" in your application directory","fixCode":"create"}]},"macos":{"isSupported":false,"reasons":[{"reasonText":"the macOS platform is not enabled for this project","fixText":"Run \"flutter create --platforms=macos .\" in your application directory","fixCode":"create"}]},"windows":{"isSupported":false,"reasons":[{"reasonText":"the Windows platform is not enabled for this project","fixText":"Run \"flutter create --platforms=windows .\" in your application directory","fixCode":"create"}]},"fuchsia":{"isSupported":false,"reasons":[{"reasonText":"the Fuchsia feature is not enabled","fixText":"Run \"flutter config --enable-fuchsia\"","fixCode":"config"},{"reasonText":"the Fuchsia platform is not enabled for this project","fixText":"Run \"flutter create --platforms=fuchsia .\" in your application directory","fixCode":"create"}]},"custom":{"isSupported":false,"reasons":[{"reasonText":"the custom devices feature is not enabled","fixText":"Run \"flutter config --enable-custom-devices\"","fixCode":"config"}]},"windowsPreview":{"isSupported":false,"reasons":[{"reasonText":"the Preview Device feature is not enabled","fixText":"Run \"flutter config --enable-flutter-preview","fixCode":"config"},{"reasonText":"the Windows platform is not enabled for this project","fixText":"Run \"flutter create --platforms=windows .\" in your application directory","fixCode":"create"}]}}}}]
    [2:18:36 PM] [General] [Info] Supported platforms for the workspace are android, ios
    [2:18:36 PM] [General] [Info] Returning cached promise for getSupportedPlatforms()
    [2:18:36 PM] [General] [Info] Returning cached promise for getSupportedPlatforms()
    [2:18:38 PM] [General] [Info] Returning cached promise for getSupportedPlatforms()
    [2:18:38 PM] [FlutterDaemon] [Info] ==> [{"id":"16","method":"daemon.getSupportedPlatforms","params":{"projectRoot":"A:\\code\\Flutter\\myapp"}}]
    [2:18:38 PM] [FlutterDaemon] [Info] <== [{"id":"16","result":{"platforms":["android","ios"],"platformTypes":{"web":{"isSupported":false,"reasons":[{"reasonText":"the Web platform is not enabled for this project","fixText":"Run \"flutter create --platforms=web .\" in your application directory","fixCode":"create"}]},"android":{"isSupported":true},"ios":{"isSupported":true},"linux":{"isSupported":false,"reasons":[{"reasonText":"the Linux platform is not enabled for this project","fixText":"Run \"flutter create --platforms=linux .\" in your application directory","fixCode":"create"}]},"macos":{"isSupported":false,"reasons":[{"reasonText":"the macOS platform is not enabled for this project","fixText":"Run \"flutter create --platforms=macos .\" in your application directory","fixCode":"create"}]},"windows":{"isSupported":false,"reasons":[{"reasonText":"the Windows platform is not enabled for this project","fixText":"Run \"flutter create --platforms=windows .\" in your application directory","fixCode":"create"}]},"fuchsia":{"isSupported":false,"reasons":[{"reasonText":"the Fuchsia feature is not enabled","fixText":"Run \"flutter config --enable-fuchsia\"","fixCode":"config"},{"reasonText":"the Fuchsia platform is not enabled for this project","fixText":"Run \"flutter create --platforms=fuchsia .\" in your application directory","fixCode":"create"}]},"custom":{"isSupported":false,"reasons":[{"reasonText":"the custom devices feature is not enabled","fixText":"Run \"flutter config --enable-custom-devices\"","fixCode":"config"}]},"windowsPreview":{"isSupported":false,"reasons":[{"reasonText":"the Preview Device feature is not enabled","fixText":"Run \"flutter config --enable-flutter-preview","fixCode":"config"},{"reasonText":"the Windows platform is not enabled for this project","fixText":"Run \"flutter create --platforms=windows .\" in your application directory","fixCode":"create"}]}}}}]
    [2:18:38 PM] [General] [Info] Getting DevTools server address to pass to Flutter...
    [2:18:38 PM] [General] [Info] Checking for errors before launching
    [2:18:38 PM] [General] [Info] Debug session starting...
        {
            "dartCodeDebugSessionID": "session-9dc29",
            "type": "dart",
            "request": "launch",
            "program": "A:\\code\\Flutter\\myapp\\lib\\main.dart",
            "projectRootPath": "A:\\code\\Flutter\\myapp",
            "cwd": "A:\\code\\Flutter\\myapp",
            "name": "Flutter (Pixel 7a API 35)",
            "deviceId": "emulator-5554",
            "deviceName": "Pixel 7a API 35 (android-x64)",
            "toolEnv": {
                "FLUTTER_HOST": "VSCode",
                "PUB_ENVIRONMENT": "vscode.dart-code",
                "FLUTTER_ROOT": "A:\\software\\flutter"
            },
            "sendLogsToClient": true,
            "sendCustomProgressEvents": true,
            "allowAnsiColorOutput": true,
            "additionalProjectPaths": [
                "A:\\code\\Flutter\\myapp"
            ],
            "args": [],
            "vmAdditionalArgs": [],
            "toolArgs": [
                "-d",
                "emulator-5554",
                "--devtools-server-address",
                "http://127.0.0.1:9100/",
                "-v"
            ],
            "vmServicePort": 0,
            "dartSdkPath": "A:\\software\\flutter\\bin\\cache\\dart-sdk",
            "maxLogLineLength": 2000,
            "debugSdkLibraries": false,
            "debugExternalPackageLibraries": false,
            "showDartDeveloperLogs": true,
            "evaluateGettersInDebugViews": true,
            "showGettersInDebugViews": true,
            "evaluateToStringInDebugViews": true,
            "flutterSdkPath": "A:\\software\\flutter",
            "useInspectorNotificationsForWidgetErrors": true,
            "showMemoryUsage": false,
            "debuggerType": 2
        }
    [2:18:38 PM] [General] [Info] Using flutter debugger for Flutter
    [2:18:38 PM] [General] [Info] SDK DAP setting is true, set by canDefaultToSdkDap and using pre-release SDK
    [2:18:38 PM] [General] [Info] Running SDK DAP Dart VM in undefined: A:\software\flutter\bin\flutter.bat debug_adapter and options {"env":{"FLUTTER_HOST":"VSCode","PUB_ENVIRONMENT":"vscode.dart-code","FLUTTER_ROOT":"A:\\software\\flutter"}}
    [2:18:38 PM] [DAP] [Info] Starting debug session 3c2ea304-79cb-48ba-97c4-a90a088978a3
    [2:18:38 PM] [DAP] [Info] Debug session 3c2ea304-79cb-48ba-97c4-a90a088978a3 errored: {"errno":-4071,"code":"EINVAL","syscall":"spawn"}
    [2:18:38 PM] [DAP] [Info] ==> {"command":"disconnect","arguments":{"restart":false},"type":"request","seq":1}
    [2:18:38 PM] [DAP] [Info] ==> {"command":"initialize","arguments":{"clientID":"vscode","clientName":"Visual Studio Code - Insiders","adapterID":"dart","pathFormat":"path","linesStartAt1":true,"columnsStartAt1":true,"supportsVariableType":true,"supportsVariablePaging":true,"supportsRunInTerminalRequest":true,"locale":"en","supportsProgressReporting":true,"supportsInvalidatedEvent":true,"supportsMemoryReferences":true,"supportsArgsCanBeInterpretedByShell":true,"supportsMemoryEvent":true,"supportsStartDebuggingRequest":true,"supportsDartUris":true},"type":"request","seq":2}
    [2:18:38 PM] [DAP] [Info] Stopping debug session 3c2ea304-79cb-48ba-97c4-a90a088978a3
    Mon Jul 29 2024 [14:18:44 GMT+0200 (Central European Summer Time)] Log file ended
    
  6. changed the title [-]Launching a new app in VSCode fails quickly with no error[/-] [+]Launching a new app in VSCode fails quickly with no error in VS Code insiders[/+] on Jul 29, 2024
  7. added
    in debuggingRelates to the debug adapter or process of running debug sessions
    and removed
    awaiting infoRequires more information from the customer to progress
    on Jul 29, 2024
  8. added this to the v3.94.0 milestone on Jul 29, 2024
  9. DanTup commented on Jul 29, 2024

    @DanTup
    Member

    Oops, I missed this error in your log the first time:

    [12:43:51 PM] [DAP] [Info] Debug session 5ecef478-128a-41f2-8851-199a2d169c50 errored: {"errno":-4071,"code":"EINVAL","syscall":"spawn"}
    

    Looks like this may be related to a NodeJS change:

    It is important to note that there has been a breaking change for Windows users who utilize child_process.spawn and child_process.spawnSync. Node.js will now error with EINVAL if a .bat or .cmd file is passed to child_process.spawn and child_process.spawnSync without the shell option set.

    I'll see if I can repro with Insiders and do some debugging.

  10. DanTup commented on Jul 29, 2024

    @DanTup
    Member

    I can repro this, but unfortunately the way we tell VS Code how to start the debug adapter does not currently support passing shell: true, so I don't have a fix.

    I've opened microsoft/vscode#224184 in the hope this can be added before VS Code ships this update.

  11. natebot13 commented on Jul 29, 2024

    @natebot13
    Author

    Thanks @nulkode for following up for me and thanks @DanTup for pinpointing the issue and following up with a VSCode PR!

  12. DanTup commented on Jul 30, 2024

    @DanTup
    Member

    It appears that my PR will not be merged to VS Code before the stable release, so we will need to find another reasonable workaround for this.

  13. DanTup commented on Jul 30, 2024

    @DanTup
    Member

    I have pushed a workaround to the pre-release extension - please try it out and let me know if you have any issues:

    Dart pre-release versions

    The VS Code devs are considering a better fix (in which case I will revert this), but I'd like to have this ready to ship in a stable release if that doesn't happen in time.

  14. DanTup commented on Jul 31, 2024

    @DanTup
    Member

    A better fix has been merged into VS Code (both main and the 1.92 release candidate) so I have reverted this workaround. Once the Insiders release updates late today (assuming they still update during release prep) I will push a new pre-release with the revert.

  15. DanTup commented on Jul 31, 2024

    @DanTup
    Member

    There's a new insiders that has the fix for this, so I have also pushed an updated pre-release (v3.93.20240731) with the reverted change. You should be sure to update your Insiders version when you get the updated extension version so the issue does not come back.

  16. nulkode commented on Aug 2, 2024

    @nulkode

    It works! Thank you!

  17. DanTup commented on Aug 2, 2024

    @DanTup
    Member

    Great, thanks for testing and confirming :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    importantSomething important!in debuggingRelates to the debug adapter or process of running debug sessionsis bug

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions