Flutter doctor: Unable to download dart sdk,BITS service failed in windows

4,158

Solution 1

use VPN and try running the command again. it worked for me.

Solution 2

Don't run an elevated command prompt - run it as a user command prompt instead.

enter image description here

Solution 3

I had the same problem.

You need to have access to internet and run then run

flutter doctor

from the command line or terminal. It should download the Dart SDK and some other tools.

My output after running flutter doctor:

flutter doctor from command line

Share:
4,158
Refat Chowdhury
Author by

Refat Chowdhury

Updated on December 16, 2022

Comments

  • Refat Chowdhury
    Refat Chowdhury over 1 year

    error showing:

    Downloading the Dart SDK using the BITS service failed, retrying with WebRequest...
    Invoke-WebRequest : The underlying connection was closed: An unexpected error occurred on a send.
    At C:\src\flutter\bin\internal\update_dart_sdk.ps1:68 char:5
    +     Invoke-WebRequest -Uri $dartSdkUrl -OutFile $dartSdkZip
    +     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebExc
       eption
        + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand
    

    Please, I need help I'm new in flutter.