MikeFranks
MikeFranks

Reputation: 11

Getting Flutter doctor to work

How do I get flutter doctor on my Windows 10 laptop to work, please? I followed the guidelines here,

Used git to clone the flutter repository,

git clone -b alpha https://github.com/flutter/flutter.git,

Tried adding "C:\Users\<user>\flutter\bin" to my path in the Control Panel and then in an Admin Powershell, tried executing flutter doctor.

At first, it just hung. After googling for help, I tried deleting the contents of the C:\Users\<user>\flutter\bin\cache folder and re-executing flutter doctor but to no avail. Then, I tried deleting all of flutter and cloning again but flutter doctor just hung again but with, Updating flutter tool.

Tried a few different Googled PATH-adding ideas (that seems to be a complex and disputed area.) Got a new message: Waiting for another flutter command to release the startuplock

The latest state is that flutter doctor still just hangs but without any message. I suspect the problem lies in the new Path not being properly recognised (in the registers??) Can anyone help please?

Upvotes: 0

Views: 18510

Answers (7)

Nachar Ahmed
Nachar Ahmed

Reputation: 1

I just install flutter folder at C:\Users....\AppData\Local\src\flutter and update environment variables. and now flutter doctor run smoothly.

Upvotes: 0

Akashgreninja
Akashgreninja

Reputation: 627

Some errors I got and how I fixed it: (ERROR 1):

  [flutter] flutter doctor -v 'crumb' is not recognized as an internal or external command, operable program or batch file. 
            Error: Unable to find git in your PATH. exit code 1

(Fix) - Go to flutter installation folder and inside flutter/bin edit the flutter.bat file using a text editor and remove the line (20) that says:

IF EXIST "%mingit_path%" SET PATH=%PATH%;%mingit_path%

The code should look like this on those lines:

REM If available, add location of bundled mingit to PATH 
SET mingit_path=%FLUTTER_ROOT%\bin\mingit\cmd

Save and Run flutter doctor and everything should work fine.

(ERROR 2):

flutter doctor takes too long

(Fix) - I downloaded the previous version of the sdk it worked like a charm.

(ERROR 3):

 Android sdkmanager not found. Update to the latest Android SDK and ensure that the cmdline-tools are installed to resolve this. 

(Fix):

  • Open Android Studio
  • Tools Menu, SDK Manager
  • In the window that comes up there are inner panels, choose SDK Tools panel
  • Tick Android SDK Command-line Tools
  • Choose Apply button near the bottom of the window

This worked.

(ERROR 4):

  The term 'flutter' is not recognized as the name of a cmdlet, function, script file, or operable program.

(Fix) - Put the correct part in the env variables. I had put D:\flutter instead of D:\flutter\bin. That worked.

Upvotes: 1

Tabish Tabish
Tabish Tabish

Reputation: 1

The Flutter SDK is installed in a protected folder and may not function correctly. Please move the SDK to a location that is user-writable without Administration permissions and restart.

Upvotes: 0

Akashgreninja
Akashgreninja

Reputation: 627

I got a solution that worked for me initially i had downloaded the 2.2.5 SDK which gave the forever run error so i went back and downloaded the previous version ie 2.2.2 it worked like a charm

Upvotes: 0

Midhun Sivaraj
Midhun Sivaraj

Reputation: 503

I know this question is a little bit old. Here is a solution that worked for me. Run the Command Prompt as an admin solved the issue for me.

Upvotes: 4

MpCodes
MpCodes

Reputation: 21

For Windows user check to see if the unzipped flutter folder is read only. (i.e right click the folder then properties then in the attributes section untick the readonly property then apply this change to the folder along with the sub-folders then ok and thats it. Worked for me.

Upvotes: 1

Shady Aziza
Shady Aziza

Reputation: 53317

Well, the issue is not clear enough, but this might be solution, if your flutter doctor is stuck, it might be due to Background Intelligent Transfer Service is disabled, in order to check for yourself, do the following:

  1. Click on the start menu, and then start typing services.
  2. Launch the services and look for Background Intelligent Transfer Service and make sure it is running. enter image description here

At this stage I believe you will find it disabled for some reason, just right click on it and go to properties and start the service, also change the startup type to automatic.

I can not think of other reasons that might prevent flutter doctor to run for the first time on a Windows machine other than that honestly.

Upvotes: 5

Related Questions