Problem when installing Flutter

Asked

Viewed 1,593 times

2

when typing the command flutter doctorcmd displays the following error:

Error: The Flutter directory is not a clone of the Github project. The flutter tool requires Git in order to Operate properly; to set up Flutter, run the following command: git clone -b stable https://github.com/flutter/flutter.git

I’ve already changed the installation path variables, reinstalled git and nothing worked, I’ve already run the command from inside the folder and unfortunately nothing happened. Could someone help me?

  • He’s complaining that Git isn’t looking for a clone or something. I don’t use Git so I don’t know how to fix it, but I recommend looking for something like this and see if there are any automatic settings active and try another editor (MS Code or Android Studio) and see if the same happens. Also see if in windows there is a configuration stored on disk with respect to some editor or extension that uses Git and try to delete.

2 answers

6

Flutter looks for a git folder that is usually hidden folder. If you used zip file copy/paste mode it may be that this folder has been lost.

You can resolve by copying the external flutter folder to include all the hidden files or run the command that the error passes, which is:

git clone -b stable https://github.com/flutter/flutter.git

And the path I took to installation was:

1 - Download sdk on official website

2 - Extract the file (renamed the folder only to flutter) and put in a location preferably without the need for privileges. - Mine is in C: flutter

3 - Add in the environment variables the path C: flutter bin or the path you select to keep sdk

1

How Voce did the flutter installation?

Make sure your version is up to date.

Use the command flutter upgrade to get the latest stable version.

If necessary, remove the installation already done and run a new installation.

Download the SDK directly on the site https://flutter.dev/docs/get-started/install/windows , then extracts the zip file within C:/src/flutter, as Google recommends and executes the file flutter_console.

If run smoothly, add the C: src flutter bin folder to the environment variables PATH.

Remembering that you need to have git installed on the machine.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.