I am receiving this error each time I open VSCode on Windows 11
The Flutter Daemon failed to start.
along with a notice telling me that packages are missing or out of date. I also receive an error when opening Andriod Studio that states:
Flutter device daemon #1 exited (exit code 255), stderr: Checking Dart SDK version… was unexpected at this time.
This only started today, everything has been working perfectly for weeks before now.
Using flutter run
in Powershell runs the application on both an emulator and a physical device with no issues, the problem appears to be with VSCode and/or Android Studio.
I have tried every fix I could find on here and other places including:
- A full Flutter reinstall in a new directory, in a new drive with a change of the PATH variables
- Deleting my .gradle folder followed by another full deletion and reinstall
- Running
flutter doctor -v
which returns a full set of green checks - Running
flutter clean
andflutter upgrade
VSCode gives me the following log on load:
[17:46:27] [General] [Info] Environment PATH:
[17:46:27] [General] [Info] C:Windowssystem32
[17:46:27] [General] [Info] C:Windows
[17:46:27] [General] [Info] C:WindowsSystem32Wbem
[17:46:27] [General] [Info] C:WindowsSystem32WindowsPowerShellv1.0
[17:46:27] [General] [Info] C:WindowsSystem32OpenSSH
[17:46:27] [General] [Info] C:Program Files (x86)NVIDIA CorporationPhysXCommon
[17:46:27] [General] [Info] C:Program Filesdotnet
[17:46:27] [General] [Info] D:Program FilesGitcmd
[17:46:27] [General] [Info] C:Program FilesNVIDIA CorporationNVIDIA NvDLISR
[17:46:27] [General] [Info] D:Program FilesPuTTY
[17:46:27] [General] [Info] D:Program Filesnodejs
[17:46:27] [General] [Info] C:WINDOWSsystem32
[17:46:27] [General] [Info] C:WINDOWS
[17:46:27] [General] [Info] C:WINDOWSSystem32Wbem
[17:46:27] [General] [Info] C:WINDOWSSystem32WindowsPowerShellv1.0
[17:46:27] [General] [Info] C:WINDOWSSystem32OpenSSH
[17:46:27] [General] [Info] C:ProgramDatachocolateybin
[17:46:27] [General] [Info] C:Program Files (x86)dotnet
[17:46:27] [General] [Info] C:UserspaultAppDataLocalMicrosoftWindowsApps
[17:46:27] [General] [Info] D:Program FilesJetBrainsIntelliJ IDEA 2021.2.3bin
[17:46:27] [General] [Info] C:UserspaultAppDataLocalatombin
[17:46:27] [General] [Info] C:UserspaultAppDataLocalnvs
[17:46:27] [General] [Info] C:UserspaultAppDataLocalGitHubDesktopbin
[17:46:27] [General] [Info] C:UserspaultAppDataRoamingnpm
[17:46:27] [General] [Info] C:UserspaultAppDataLocalMicrosoftWindowsApps
[17:46:27] [General] [Info] C:Program Filesherokubin
[17:46:27] [General] [Info] C:UserspaultAppDataRoamingPubCachebin
[17:46:27] [General] [Info] C:UserspaultAppDataLocalProgramsMicrosoft VS Codebin
[17:46:27] [General] [Info] D:srcflutterbin
[17:46:27] [General] [Info] Took 306ms to search for projects (5 levels)
[17:46:27] [General] [Info] Took 3ms to filter out excluded projects (0 exclusion rules)
[17:46:27] [General] [Info] Found Flutter project at E:Fluttertest_app:
Mobile? true
Web? false
Create Trigger? false
Flutter Repo? false
[17:46:27] [General] [Info] Searching for flutter.bat
[17:46:27] [General] [Info] Looking for flutter.bat in:
[17:46:27] [General] [Info] C:toolsflutter
[17:46:27] [General] [Info] C:toolsflutterbin
[17:46:27] [General] [Info] E:Fluttertest_app
[17:46:27] [General] [Info] E:Fluttertest_appbin
[17:46:27] [General] [Info] C:srcflutterbin
[17:46:27] [General] [Info] E:Fluttertest_app.flutter
[17:46:27] [General] [Info] E:Fluttertest_app.flutterbin
[17:46:27] [General] [Info] E:Fluttertest_appvendorflutter
[17:46:27] [General] [Info] E:Fluttertest_appvendorflutterbin
[17:46:27] [General] [Info] C:Userspaultflutter-sdk
[17:46:27] [General] [Info] C:Userspaultflutter-sdkbin
[17:46:27] [General] [Info] /google/flutter
[17:46:27] [General] [Info] googleflutterbin
[17:46:27] [General] [Info] C:Windowssystem32
[17:46:27] [General] [Info] C:Windowssystem32bin
[17:46:27] [General] [Info] C:Windows
[17:46:27] [General] [Info] C:Windowsbin
[17:46:27] [General] [Info] C:WindowsSystem32Wbem
[17:46:27] [General] [Info] C:WindowsSystem32Wbembin
[17:46:27] [General] [Info] C:WindowsSystem32WindowsPowerShellv1.0
[17:46:27] [General] [Info] C:WindowsSystem32WindowsPowerShellv1.0bin
[17:46:27] [General] [Info] C:WindowsSystem32OpenSSH
[17:46:27] [General] [Info] C:WindowsSystem32OpenSSHbin
[17:46:27] [General] [Info] C:Program Files (x86)NVIDIA CorporationPhysXCommon
[17:46:27] [General] [Info] C:Program Files (x86)NVIDIA CorporationPhysXCommonbin
[17:46:27] [General] [Info] C:Program Filesdotnet
[17:46:27] [General] [Info] C:Program Filesdotnetbin
[17:46:27] [General] [Info] D:Program FilesGitcmd
[17:46:27] [General] [Info] D:Program FilesGitcmdbin
[17:46:27] [General] [Info] C:Program FilesNVIDIA CorporationNVIDIA NvDLISR
[17:46:27] [General] [Info] C:Program FilesNVIDIA CorporationNVIDIA NvDLISRbin
[17:46:27] [General] [Info] D:Program FilesPuTTY
[17:46:27] [General] [Info] D:Program FilesPuTTYbin
[17:46:27] [General] [Info] D:Program Filesnodejs
[17:46:27] [General] [Info] D:Program Filesnodejsbin
[17:46:27] [General] [Info] C:WINDOWSsystem32
[17:46:27] [General] [Info] C:WINDOWSsystem32bin
[17:46:27] [General] [Info] C:WINDOWS
[17:46:27] [General] [Info] C:WINDOWSbin
[17:46:27] [General] [Info] C:WINDOWSSystem32Wbem
[17:46:27] [General] [Info] C:WINDOWSSystem32Wbembin
[17:46:27] [General] [Info] C:WINDOWSSystem32WindowsPowerShellv1.0
[17:46:27] [General] [Info] C:WINDOWSSystem32WindowsPowerShellv1.0bin
[17:46:27] [General] [Info] C:WINDOWSSystem32OpenSSH
[17:46:27] [General] [Info] C:WINDOWSSystem32OpenSSHbin
[17:46:27] [General] [Info] C:ProgramDatachocolateybin
[17:46:27] [General] [Info] C:Program Files (x86)dotnet
[17:46:27] [General] [Info] C:Program Files (x86)dotnetbin
[17:46:27] [General] [Info] C:UserspaultAppDataLocalMicrosoftWindowsApps
[17:46:27] [General] [Info] C:UserspaultAppDataLocalMicrosoftWindowsAppsbin
[17:46:27] [General] [Info] D:Program FilesJetBrainsIntelliJ IDEA 2021.2.3bin
[17:46:27] [General] [Info] C:UserspaultAppDataLocalatombin
[17:46:27] [General] [Info] C:UserspaultAppDataLocalnvs
[17:46:27] [General] [Info] C:UserspaultAppDataLocalnvsbin
[17:46:27] [General] [Info] C:UserspaultAppDataLocalGitHubDesktopbin
[17:46:27] [General] [Info] C:UserspaultAppDataRoamingnpm
[17:46:27] [General] [Info] C:UserspaultAppDataRoamingnpmbin
[17:46:27] [General] [Info] C:UserspaultAppDataLocalMicrosoftWindowsApps
[17:46:27] [General] [Info] C:UserspaultAppDataLocalMicrosoftWindowsAppsbin
[17:46:27] [General] [Info] C:Program Filesherokubin
[17:46:27] [General] [Info] C:UserspaultAppDataRoamingPubCachebin
[17:46:27] [General] [Info] C:UserspaultAppDataLocalProgramsMicrosoft VS Codebin
[17:46:27] [General] [Info] D:srcflutterbin
[17:46:27] [General] [Info] Found at:
[17:46:27] [General] [Info] C:toolsflutterbin
[17:46:27] [General] [Info] D:srcflutterbin
[17:46:27] [General] [Info] Candidate paths to be post-filtered:
[17:46:27] [General] [Info] C:toolsflutter
[17:46:27] [General] [Info] D:srcflutter
[17:46:27] [General] [Info] Found at C:toolsflutter
[17:46:27] [General] [Info] Returning SDK path C:toolsflutter for flutter.bat
[17:46:27] [General] [Info] Searching for dart.exe
[17:46:27] [General] [Info] Looking for dart.exe in:
[17:46:27] [General] [Info] C:toolsflutterbincachedart-sdk
[17:46:27] [General] [Info] C:toolsflutterbincachedart-sdkbin
[17:46:27] [General] [Info] C:Windowssystem32
[17:46:27] [General] [Info] C:Windowssystem32bin
[17:46:27] [General] [Info] C:Windows
[17:46:27] [General] [Info] C:Windowsbin
[17:46:27] [General] [Info] C:WindowsSystem32Wbem
[17:46:27] [General] [Info] C:WindowsSystem32Wbembin
[17:46:27] [General] [Info] C:WindowsSystem32WindowsPowerShellv1.0
[17:46:27] [General] [Info] C:WindowsSystem32WindowsPowerShellv1.0bin
[17:46:27] [General] [Info] C:WindowsSystem32OpenSSH
[17:46:27] [General] [Info] C:WindowsSystem32OpenSSHbin
[17:46:27] [General] [Info] C:Program Files (x86)NVIDIA CorporationPhysXCommon
[17:46:27] [General] [Info] C:Program Files (x86)NVIDIA CorporationPhysXCommonbin
[17:46:27] [General] [Info] C:Program Filesdotnet
[17:46:27] [General] [Info] C:Program Filesdotnetbin
[17:46:27] [General] [Info] D:Program FilesGitcmd
[17:46:27] [General] [Info] D:Program FilesGitcmdbin
[17:46:27] [General] [Info] C:Program FilesNVIDIA CorporationNVIDIA NvDLISR
[17:46:27] [General] [Info] C:Program FilesNVIDIA CorporationNVIDIA NvDLISRbin
[17:46:27] [General] [Info] D:Program FilesPuTTY
[17:46:27] [General] [Info] D:Program FilesPuTTYbin
[17:46:27] [General] [Info] D:Program Filesnodejs
[17:46:27] [General] [Info] D:Program Filesnodejsbin
[17:46:27] [General] [Info] C:WINDOWSsystem32
[17:46:27] [General] [Info] C:WINDOWSsystem32bin
[17:46:27] [General] [Info] C:WINDOWS
[17:46:27] [General] [Info] C:WINDOWSbin
[17:46:27] [General] [Info] C:WINDOWSSystem32Wbem
[17:46:27] [General] [Info] C:WINDOWSSystem32Wbembin
[17:46:27] [General] [Info] C:WINDOWSSystem32WindowsPowerShellv1.0
[17:46:27] [General] [Info] C:WINDOWSSystem32WindowsPowerShellv1.0bin
[17:46:27] [General] [Info] C:WINDOWSSystem32OpenSSH
[17:46:27] [General] [Info] C:WINDOWSSystem32OpenSSHbin
[17:46:27] [General] [Info] C:ProgramDatachocolateybin
[17:46:27] [General] [Info] C:Program Files (x86)dotnet
[17:46:27] [General] [Info] C:Program Files (x86)dotnetbin
[17:46:27] [General] [Info] C:UserspaultAppDataLocalMicrosoftWindowsApps
[17:46:27] [General] [Info] C:UserspaultAppDataLocalMicrosoftWindowsAppsbin
[17:46:27] [General] [Info] D:Program FilesJetBrainsIntelliJ IDEA 2021.2.3bin
[17:46:27] [General] [Info] C:UserspaultAppDataLocalatombin
[17:46:27] [General] [Info] C:UserspaultAppDataLocalnvs
[17:46:27] [General] [Info] C:UserspaultAppDataLocalnvsbin
[17:46:27] [General] [Info] C:UserspaultAppDataLocalGitHubDesktopbin
[17:46:27] [General] [Info] C:UserspaultAppDataRoamingnpm
[17:46:27] [General] [Info] C:UserspaultAppDataRoamingnpmbin
[17:46:27] [General] [Info] C:UserspaultAppDataLocalMicrosoftWindowsApps
[17:46:27] [General] [Info] C:UserspaultAppDataLocalMicrosoftWindowsAppsbin
[17:46:27] [General] [Info] C:Program Filesherokubin
[17:46:27] [General] [Info] C:UserspaultAppDataRoamingPubCachebin
[17:46:27] [General] [Info] C:UserspaultAppDataLocalProgramsMicrosoft VS Codebin
[17:46:27] [General] [Info] D:srcflutterbin
[17:46:27] [General] [Info] C:toolsflutterbincachedart-sdk
[17:46:27] [General] [Info] C:toolsflutterbincachedart-sdkbin
[17:46:27] [General] [Info] Found at:
[17:46:27] [General] [Info] C:toolsflutterbincachedart-sdkbin
[17:46:27] [General] [Info] C:toolsflutterbincachedart-sdkbin
[17:46:27] [General] [Info] Candidate paths to be post-filtered:
[17:46:27] [General] [Info] C:toolsflutterbincachedart-sdk
[17:46:27] [General] [Info] C:toolsflutterbincachedart-sdk
[17:46:27] [General] [Info] Found at C:toolsflutterbincachedart-sdk
[17:46:27] [General] [Info] Returning SDK path C:toolsflutterbincachedart-sdk for dart.exe
[17:46:27] [General] [Info] Experiment random number is 98 for experiment 'sdkDaps'. Experiment is enabled for <= 10
[17:46:27] [General] [Info] Experiment 'sdkDaps' does not apply and will not be activated
[17:46:27] [General] [Info] !! PLEASE REVIEW THIS LOG FOR SENSITIVE INFORMATION BEFORE SHARING !!
Dart Code extension: 3.48.3
Flutter extension: 3.48.0 (not activated)
App: Visual Studio Code
Version: 1.71.0
Platform: win
Workspace type: Flutter
Analyzer type: LSP
Multi-root?: false
Dart SDK:
Loc: C:toolsflutterbincachedart-sdk
Ver: 2.16.2
Flutter SDK:
Loc: C:toolsflutter
Ver: 2.10.5
HTTP_PROXY: undefined
NO_PROXY: undefined
[17:46:27] [FlutterDaemon] [Info] Spawning C:toolsflutterbinflutter.bat with args ["daemon"]
[17:46:27] [FlutterDaemon] [Info] .. in C:toolsflutter
[17:46:27] [FlutterDaemon] [Info] .. with {"toolEnv":{"FLUTTER_HOST":"VSCode","PUB_ENVIRONMENT":"vscode.dart-code"}}
[17:46:28] [FlutterDaemon] [Info] PID: 11176
[17:46:28] [FlutterDaemon] [Info] ==> [{"id":"1","method":"emulator.getEmulators"}]
[17:46:28] [DevTools] [Info] Spawning C:toolsflutterbincachedart-sdkbindart.exe with args ["devtools","--machine","--try-ports","10","--allow-embedding"]
[17:46:28] [DevTools] [Info] .. with {"toolEnv":{"FLUTTER_HOST":"VSCode","PUB_ENVIRONMENT":"vscode.dart-code"}}
[17:46:28] [DevTools] [Info] PID: 11176
[17:46:28] [Analyzer] [Info] Spawning C:toolsflutterbincachedart-sdkbindart.exe with args ["language-server","--protocol=lsp","--client-id=VS-Code","--client-version=3.48.3"]
[17:46:28] [Analyzer] [Info] PID: 2456
[17:46:28] [General] [Info] Returning cached results for project search
[17:46:28] [General] [Info] Activating Flutter extension for Flutter project...
[17:46:28] [General] [Info] Extension:Startup timing: 401ms
[17:46:28] [General] [Info] Found 1 folders requiring "pub get":
E:Fluttertest_app
[17:46:28] [Analyzer] [Info] ==> Content-Length: 6247
[17:46:28] [Analyzer] [Info] ==> {"jsonrpc":"2.0","id":0,"method":"initialize","params":{"processId":11176,"clientInfo":{"name":"Visual Studio Code","version":"1.71.0"},"locale":"en-gb","rootPath":"e:\Flutter\test_app","rootUri":"file:///e%3A/Flutter/test_app","capabilities":{"workspace":{"applyEdit":true,"workspaceEdit":{"documentChanges":true,"resourceOperations":["create","rename","delete"],"failureHandling":"textOnlyTransactional","normalizesLineEndings":true,"changeAnnotationSupport":{"groupsOnLabel":true}},"configur…
[17:46:28] [General] [Info] Caching Pub package names from pub.dev...
[17:46:28] [General] [Info] !! PLEASE REVIEW THIS LOG FOR SENSITIVE INFORMATION BEFORE SHARING !!
Dart Code extension: 3.48.3
Flutter extension: 3.48.0 (activated)
App: Visual Studio Code
Version: 1.71.0
Platform: win
Workspace type: Flutter
Analyzer type: LSP
Multi-root?: false
Dart SDK:
Loc: C:toolsflutterbincachedart-sdk
Ver: 2.16.2
Flutter SDK:
Loc: C:toolsflutter
Ver: 2.10.5
HTTP_PROXY: undefined
NO_PROXY: undefined
[17:46:28] [FlutterDaemon] [Error] Checking Dart SDK version...
<< was unexpected at this time.```
4
Answers
Neither of the comment suggestions provided a fix, I had already been into those questions and attempted the fixes provided.
I took another shot today and eventually found the issue. At some point the Dart and Flutter SDK paths inside VSCode became corrupted, it ended up simply being a case of going to settings and editing the
settings.json
file to point to the new locations, this has fixed the issue.When i run ‘flutter doctor’ it give me all green checks. but vscode gave me ‘flutter daemon failed to start’ error.
I think it was a problem of settings and paths.
So, I recommend you reinstall vscode(stable) and init your vscode settings.
I worked for me.
Remove Vscode and settings(something like cache)
Reinstall Vscode and flutter extensions.(It includes Dart pkg now(2023.1) )
If still raise this error, check your configs about tool_state of flutter
In my case(M1 MacOS) typed this code and worked!
"sudo chown -R $(whoami) /Users/{user_name}/.config/flutter/tool_state"
I delete the –no-sound-null-safety Flutter additional arg, then restart VS Code and then re-add the –no-sound-null-safety additional arg since it is required for my app to be able to start.
please change flutter sdk path and update path , enviroment variables and restart your system issue will be resolved , else download new setup of flutter and install