'Flutter doctor -v' STUCK at 'downloading SDK from Flutter Engine'

Viewed 3567

Microsoft Windows [Version 6.3.9600] 
(c) 2013 Microsoft Corporation. All rights reserved.

C:\Users\DELL>flutter doctor -v 
Checking Dart SDK version... 
Downloading Dart SDK from Flutter engine 6bc433c6b6b5b98dcf4cc11aff31cdee90849f3
    2...

This is where the console gets stuck. The issue began when VS code prompted me to upgrade the flutter extension. I felt it was taking too much time (possibly due to a network error) so I cancelled it. Now my Android Studio Emulator can not get connected with the VS code.

[11:12:25 AM] [General] [Info] Searching for SDKs...
[11:12:25 AM] [General] [Info] Environment PATH:
[11:12:25 AM] [General] [Info]     C:\Windows\system32
[11:12:25 AM] [General] [Info]     C:\Windows
[11:12:25 AM] [General] [Info]     C:\Windows\System32\Wbem
[11:12:25 AM] [General] [Info]     C:\Windows\System32\WindowsPowerShell\v1.0\
[11:12:25 AM] [General] [Info]     C:\Program Files (x86)\Skype\Phone\
[11:12:25 AM] [General] [Info]     C:\Program Files\Git\cmd
[11:12:25 AM] [General] [Info]     C:\Program Files\nodejs\
[11:12:25 AM] [General] [Info]     C:\Users\DELL\flutter_windows_1.17.0-stable\flutter\bin
[11:12:25 AM] [General] [Info]     E:\Microsoft VS Code\bin
[11:12:25 AM] [General] [Info]     C:\Users\DELL\AppData\Roaming\npm
[11:12:25 AM] [General] [Info] Found Flutter project at C:\Users\DELL\Desktop\Writer's Haven\writerHaven:
            Mobile? true
            Web? false
            Create Trigger? false
            Flutter Repo? false
[11:12:25 AM] [General] [Info] Searching for flutter.bat
[11:12:25 AM] [General] [Info]     Looking for flutter.bat in:
[11:12:25 AM] [General] [Info]         C:\Users\DELL\Desktop\Writer's Haven\writerHaven
[11:12:25 AM] [General] [Info]         C:\Users\DELL\Desktop\Writer's Haven\writerHaven\bin
[11:12:25 AM] [General] [Info]         C:\flutter\bin\
[11:12:25 AM] [General] [Info]         C:\Users\DELL\Desktop\Writer's Haven\writerHaven\.flutter
[11:12:25 AM] [General] [Info]         C:\Users\DELL\Desktop\Writer's Haven\writerHaven\.flutter\bin
[11:12:25 AM] [General] [Info]         C:\Users\DELL\Desktop\Writer's Haven\writerHaven\vendor\flutter
[11:12:25 AM] [General] [Info]         C:\Users\DELL\Desktop\Writer's Haven\writerHaven\vendor\flutter\bin
[11:12:25 AM] [General] [Info]         C:\Windows\system32
[11:12:25 AM] [General] [Info]         C:\Windows\system32\bin
[11:12:25 AM] [General] [Info]         C:\Windows
[11:12:25 AM] [General] [Info]         C:\Windows\bin
[11:12:25 AM] [General] [Info]         C:\Windows\System32\Wbem
[11:12:25 AM] [General] [Info]         C:\Windows\System32\Wbem\bin
[11:12:25 AM] [General] [Info]         C:\Windows\System32\WindowsPowerShell\v1.0\
[11:12:25 AM] [General] [Info]         C:\Windows\System32\WindowsPowerShell\v1.0\bin
[11:12:25 AM] [General] [Info]         C:\Program Files (x86)\Skype\Phone\
[11:12:25 AM] [General] [Info]         C:\Program Files (x86)\Skype\Phone\bin
[11:12:25 AM] [General] [Info]         C:\Program Files\Git\cmd
[11:12:25 AM] [General] [Info]         C:\Program Files\Git\cmd\bin
[11:12:25 AM] [General] [Info]         C:\Program Files\nodejs\
[11:12:25 AM] [General] [Info]         C:\Program Files\nodejs\bin
[11:12:25 AM] [General] [Info]         C:\Users\DELL\flutter_windows_1.17.0-stable\flutter\bin
[11:12:25 AM] [General] [Info]         E:\Microsoft VS Code\bin
[11:12:25 AM] [General] [Info]         C:\Users\DELL\AppData\Roaming\npm
[11:12:25 AM] [General] [Info]         C:\Users\DELL\AppData\Roaming\npm\bin
[11:12:25 AM] [General] [Info]     Found at:
[11:12:25 AM] [General] [Info]         C:\flutter\bin\
[11:12:25 AM] [General] [Info]         C:\Users\DELL\flutter_windows_1.17.0-stable\flutter\bin
[11:12:25 AM] [General] [Info]     Candidate paths to be post-filtered:
[11:12:25 AM] [General] [Info]         C:\flutter
[11:12:25 AM] [General] [Info]         C:\Users\DELL\flutter_windows_1.17.0-stable\flutter
[11:12:25 AM] [General] [Info]     Found at C:\flutter
[11:12:25 AM] [General] [Info]     Returning SDK path C:\flutter for flutter.bat
[11:12:25 AM] [General] [Info] Searching for dart.exe
[11:12:25 AM] [General] [Info]     Looking for dart.exe in:
[11:12:25 AM] [General] [Info]         C:\flutter\bin\cache\dart-sdk
[11:12:25 AM] [General] [Info]         C:\flutter\bin\cache\dart-sdk\bin
[11:12:25 AM] [General] [Info]         C:\Windows\system32
[11:12:25 AM] [General] [Info]         C:\Windows\system32\bin
[11:12:25 AM] [General] [Info]         C:\Windows
[11:12:25 AM] [General] [Info]         C:\Windows\bin
[11:12:25 AM] [General] [Info]         C:\Windows\System32\Wbem
[11:12:25 AM] [General] [Info]         C:\Windows\System32\Wbem\bin
[11:12:25 AM] [General] [Info]         C:\Windows\System32\WindowsPowerShell\v1.0\
[11:12:25 AM] [General] [Info]         C:\Windows\System32\WindowsPowerShell\v1.0\bin
[11:12:25 AM] [General] [Info]         C:\Program Files (x86)\Skype\Phone\
[11:12:25 AM] [General] [Info]         C:\Program Files (x86)\Skype\Phone\bin
[11:12:25 AM] [General] [Info]         C:\Program Files\Git\cmd
[11:12:25 AM] [General] [Info]         C:\Program Files\Git\cmd\bin
[11:12:25 AM] [General] [Info]         C:\Program Files\nodejs\
[11:12:25 AM] [General] [Info]         C:\Program Files\nodejs\bin
[11:12:25 AM] [General] [Info]         C:\Users\DELL\flutter_windows_1.17.0-stable\flutter\bin
[11:12:25 AM] [General] [Info]         E:\Microsoft VS Code\bin
[11:12:25 AM] [General] [Info]         C:\Users\DELL\AppData\Roaming\npm
[11:12:25 AM] [General] [Info]         C:\Users\DELL\AppData\Roaming\npm\bin
[11:12:25 AM] [General] [Info]         C:\flutter\bin\cache\dart-sdk
[11:12:25 AM] [General] [Info]         C:\flutter\bin\cache\dart-sdk\bin
[11:12:25 AM] [General] [Info]     Found at:
[11:12:25 AM] [General] [Info]     Candidate paths to be post-filtered:
[11:12:25 AM] [General] [Info]     Returning SDK path undefined for dart.exe

I have also tried to change Environment Variable path and use the flutter console.bat directly using Administrator rights. Even used Git Bash but to no avail. In the end I also deleted the cache inside the flutter\bin folder. My flutter directory is

C:\Users\DELL\flutter_windows_1.17.0-stable\flutter\bin

4 Answers

I faced this issue on windows, I think it was due a proxy thing issue. I've come across this solution in github provided for a similar issue. I'll mention the main steps again though:

  1. Go the flutter sdk folder (In my case it was in C:\src\flutter )

  2. Go to bin\internal

  3. Open the file update_dart_sdk.ps1

  4. After this line of code Import-Module BitsTransfer, in the Try block, add the following:

    If($httpProxy = ([System.Uri] $env:http_proxy)){
    $proxyUserInfo = $httpProxy.UserInfo.Split(":")
    $proxyPass = ConvertTo-SecureString $proxyUserInfo[1] -AsPlainText -Force
    $proxyCredential = New-Object System.Management.Automation.PSCredential 
       ($proxyUserInfo[0], $proxyPass)
    Start-BitsTransfer -Source $dartSdkUrl -Destination $dartSdkZip - 
       ProxyUsage Override -ProxyList ($httpProxy.Host + ":" + 
       $httpProxy.Port) -ProxyCredential $proxyCredential - 
       ProxyAuthentication Basic    
    }Else{
      Start-BitsTransfer -Source $dartSdkUrl -Destination $dartSdkZip
    }
    

Just run flutter doctor again. it will download again

enter image description here

Try a this solution found here

  1. delete folder in your sdk path flutter/bin/cache (detail info here)

  2. run flutter doctor -v again will trigger downloading Dart SDK

  3. export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn (detail info here)

  4. flutter channel stable (one example of change flutter channel)

  5. flutter doctor -v (trigger downloading SDK)

Edit : Other things you can try :

Delete Cache folder under flutter/bin

Open another Flutter project in VSCode

Inside the Flutter directory try running dart --version and updating your OP with it

i think the flutter needs a disk storage space without administrative privileges. So you can install on your D drive

Related