Exaucé Umba
Exaucé Umba

Reputation: 1

Error install flutter and no execute flutter command on windows

I added flutter in the path, but nothing works, the terminal still does not recognize it even when I reinstall, it's the same error

HP@DESKTOP-S0EN4J3 MINGW64 ~
$ flutter --version
fatal: detected dubious ownership in repository at 'C:/flutter/flutter'
'C:/flutter/flutter' is owned by: BUILTIN/Administrateurs (S-1-5-32-544)
but the current user is: DESKTOP-S0EN4J3/HP (S-1-5-21-3395073662-1185252331-4202032673-1001)
To add an exception for this directory, call:
git config --global --add safe.directory C:/flutter/flutter
Error: Unable to determine engine version...

HP@DESKTOP-S0EN4J3 MINGW64 ~
$ flutter doctor
fatal: detected dubious ownership in repository at 'C:/flutter/flutter'
'C:/flutter/flutter' is owned by: BUILTIN/Administrateurs (S-1-5-32-544)
but the current user is: DESKTOP-S0EN4J3/HP (S-1-5-21-3395073662-1185252331-4202032673-1001)
To add an exception for this directory, call:
git config --global --add safe.directory C:/flutter/flutter
Error: Unable to determine engine version...
After execute : git config --global --add safe.directory C:/flutter/flutter

HP@DESKTOP-S0EN4J3 MINGW64 ~
$ flutter --version
f73bfc4522dd0bc87bbcdb4bb3088082755c5e87 était inattendu.
HP@DESKTOP-S0EN4J3 MINGW64 ~
$ flutter doctor
f73bfc4522dd0bc87bbcdb4bb3088082755c5e87 était inattendu.

Upvotes: -3

Views: 124

Answers (2)

jkhines
jkhines

Reputation: 1139

I had the same issue when installing Flutter on a Windows system where I am not a member of the local Administrators group. My repro steps were:

  1. Download the Flutter SDK.
  2. Run an elevated PowerShell prompt.
  3. Create the parent folder for the SDK in C:\dev.
  4. Extract the flutter_windows_3.29.0-stable.zip into C:\dev.
  5. Add C:\dev\flutter\bin to my PATH.
  6. Run flutter doctor.

This seems to create a situation where there is a different owner of the folder containing the Flutter SDK (BUILTIN/Administrateurs) and the user running the SDK (DESKTOP-S0EN4J3/HP). I saw the same error that you did: "f73bfc4522dd0bc87bbcdb4bb3088082755c5e87 was unexpected at this time". I also had issues running the Flutter daemon from VS Code.

I fixed this by starting over and using VS Code to install the SDK as the non-admin user (DESKTOP-S0EN4J3/HP):

  1. Delete C:\dev from disk and remove it from PATH.
  2. Run Visual Studio Code.
  3. Install the Flutter VS Code extension.
  4. Press Ctrl-Shift-P and type flutter.
  5. Select 'Flutter: New Project'.
  6. When prompted for an installation folder, I created a new folder called %USERPROFILE%\dev (In your case, C:\Users\HP\dev).
  7. Visual Studio Code will then download and extract the SDK for you.
  8. VS Code will prompt you to add the SDK to your PATH. Click Yes.
  9. If you want, click OK for the Google Analytics prompt.

I then selected 'Application' to let VS Code finish its process. From this point I was able to launch a new elevated PowerShell prompt and run flutter --version and flutter doctor successfully.

By running VS Code with user privileges and using it to install the Flutter SDK under %USERPROFILE%\dev, there shouldn't be any mismatch between directory owners and you should have permissions to all Flutter SDK assets.

I could have also fixed my problem by executing the repro steps with a non-elevated PowerShell prompt and installing the Flutter SDK under %USERPROFILE%, but I'm not sure how you got into the state you are in so using VS Code seems like a more universal solution. Hope this helps.

Upvotes: 0

Mahmoud Al-shehyby
Mahmoud Al-shehyby

Reputation: 355

Try to add :

C:/flutter/flutter/bin and C:/flutter/flutter

in the Path of the System variable also in the Path of the user variables

Then run the command flutter doctor

Upvotes: 0

Related Questions