flutter doctor hangs after “Updating flutter tool…”

First: I have used Google to search for "flutter doctor" and searched your
site as well. I will detail my results below, but before that here is where I am:

1) I followed the directions at https://flutter.io/setup-windows/ up to the point where I am unable to proceed.

2) My environment is:
Windows 10, 64 bit, 210 Gb free space
Intel(R) Core(TM) i5-2320 CPU @ 3.00GHz; 8.00 GB installed memory(RAM)

I have PowerShell 5.1,
I have setup Git for Windows with "Use Git from
the Windows Command Prompt" option
I am able to run git from the command prompt or power shell


3) I tried downloading the .zip of the beta but when I ran the
"flutter doctor" command it just hung.

4) Now for the search results:
I found 3 relevant questions:

a) "Getting Flutter doctor to work" - I tried cloning the "alpha" version
and checked the "Background Intelligent Transfer Service was running" (it
was).

b) "Running Flutter Doctor without any results" - I removed the alpha version
and cloned the beta version using git bash with the following results:

rex@NEXIUM MINGW64 /c/flutter
$ git clone -b beta https://github.com/flutter/flutter.git
Cloning into 'flutter'...
remote: Counting objects: 122267, done.
remote: Compressing objects: 100% (5/5), done.
remote: Total 122267 (delta 0), reused 0 (delta 0), pack-reused 122262
Receiving objects: 100% (122267/122267), 37.56 MiB | 2.39 MiB/s, done.
Resolving deltas: 100% (91730/91730), done.
Checking out files: 100% (2473/2473), done.

This also did not work (i.e. flutter doctor still hangs)


c) "Flutter doctor is not running in command prompt" - this one had the most
promising result:

I deleted the cache folder under the ..\AppData\Roaming\Pub directory.
when I ran "flutter doctor" this time I got the following results:

C:\Users\rex>flutter doctor
Checking Dart SDK version...
Downloading Dart SDK from Flutter engine 09d05a38912a3c1a906e95099cac9a7e14fae85f...
Unzipping Dart SDK...
// here there was some text above the ========== in the console about bits...
// which went away, window appeared compressed and then the following message:
Updating flutter tool...
// HANGS HERE


I am hoping to get the flutter tool installed and experiment with it for developing android and/or iOS apps. I have done some development using Xamarin in the Visual Studio 2017 but there is limited support for controls and I am
hoping that this tool will be more productive. IF there is anyone who can help me get past this problem I would appreciate any help. Thanks,
Rex

NEW INFORMATION BELOW:

I tried running the flutter doctor command in a command window with adminstrator privilege with the same result. It then tried editing the flutter.bat file with some echo commands to try to get additional information which showed me that the batch file was getting to the point where the following statement is executed:

>CALL "%dart%" %FLUTTER_TOOL_ARGS% "%snapshot_path%" %*


I edited the batch file to uncomment the lines assigning the FLUTTER_TOOL_ARGS which gave me additional information and the batch file exited as follows:
================== results in the command window =====================

>C:\Windows\System32>flutter doctor
>in acquire_lock ... # ECHO to get debug information
>in subroutine ... # ECHO to get debug information
>in after_subroutine ...# ECHO to get debug information
>dart - C:\src\flutter\flutter\bin\cache\dart-sdk\bin\dart.exe # ECHO dart
>FLUTTER_TOOL_ARGS ""--checked " --observe=65432" # ECHO FLUTTER_TOOL_ARGS
#next line is ECHO of snapshot_path
>snapshot_path C:\src\flutter\flutter\bin\cache\flutter_tools.snapshot

============== the following was output from the batch file =========

Unhandled exception:
Could not load "file:///C:/Windows/System32/%20--observe=65432":
FileSystemException: Cannot open file, path =
'C:\Windows\System32\ -->observe=65432'
(OS Error: The system cannot find the file specified. , errno = >2) null
# another ECHO
after CALL ... # echo to get debug information


================== end of results in the command window =====================

=========== ANOTHER NEW EDIT =============

Just to clarify the above edit, I totally deleted everything related to flutter and then re-installed/unzipped it in another directory "C:\src\flutter" which does not require admin privilege to edit, etc. but I did not delete the cache folder under the ..\AppData\Roaming\Pub directory as before so I am going back to do that this morning. I will also use the -v or -verbose option at the command prompt to see if there is any additional help and add the new information once done.

============== FOLLOW UP EDIT ================

I remove some of the debug ECHO statements, modified others, made sure 7z.exe is in the path, removed the cache directory but the results are basically the same as follows:

C:\WINDOWS\system32>flutter doctor -verbose
Show dart, FLUTTER_TOOL_ARGS, and snapshot_path:
dart - C:\src\flutter\flutter\bin\cache\dart-sdk\bin\dart.exe
FLUTTER_TOOL_ARGS ""--checked " --observe=65432"
snapshot_path C:\src\flutter\flutter\bin\cache\flutter_tools.snapshot
execute call to dart ...
Unhandled exception:
Could not load "file:///C:/Windows/System32/%20--observe=65432":
FileSystemException: Cannot open file, path =
'C:\Windows\System32\ --observe=65432' (OS Error: The system cannot find
the file specified., errno = 2)
null
returned from call to dart
exit code 255

C:\Windows\System32>

============ Another Update ===========


I decided to try the clone of the beta again since that was the most promising of all the previous things I did. When done I used the power shell and issued the "flutter channel" command just to see what that would do. Surprisingly I got a similar result to running "flutter doctor" previously. First there was an output at the top of the screen showing dart being downloaded and then when that was done the following was printed on the console below the original command:

C:\Users\rex>flutter channel
Checking Dart SDK version...
Downloading Dart SDK from Flutter engine
1ed25ca7b7e3e3e8047df050bba4174074c9b336...
Unzipping Dart SDK...
Updating flutter tool...


and then the console hung as before...

I finally aborted the command and set echo on in flutter.bat. That file hangs with the following command displayed on the screen (all on the same line):

C:\src\flutter>CALL "C:\src\flutter\bin\cache\dart-sdk\bin\dart.exe"
"--checked --observe=65432"
"C:\src\flutter\bin\cache\flutter_tools.snapshot" doctor


At this point I am pretty much at a loss.

Have tried the following?

Run the flutter doctor command from a command prompt with admin privileges?

Tried installing a different type of unzip program (like 7-zip) and ensuring it's in the PATH?

BTW I'm looking at this issue that seems similar to what you are describing: https://github.com/flutter/flutter/issues/11698

Seems like you don't have enough privilege to save or edit files in that directory.
Try to run your command prompt as admin or try to run your flutter console as admin and check if that helps.

Comments

Popular posts from this blog

Meaning of `{}` for return expression

Get current scroll position of ScrollView in React Native

Chart JS +ng2-charts not working on Angular+2