Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The Flutter Directory Is Not A Clone of GitHub Project

Tags:

flutter

I had downloaded Flutter from https://flutter.io/setup-windows/ (flutter_windows_v0.5.1-beta.zip) in windows 10 and followed the guidelines, extracted the zip in C:\Users\M. Junaid and opened flutter-console.bat. I tried to run flutter doctor but got the following

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

Flutter Error

Re-checked the dependencies Git and PowerShell which are correctly installed and path variable is also correct - C:\Users\M.Junaid\flutter\bin

I Tried These But Nothing Worked:

  1. Tried to extract in different locations C:\flutter, in AppData etc.
  2. Running flutter_console.bat as administrator.
  3. cd flutter and then running the command
like image 270
MJ Sabri Avatar asked Jul 14 '18 03:07

MJ Sabri


3 Answers

Flutter checks for a git folder, which is normally a hidden folder. If you copied and pasted the contents of the zip file, there is a good chance that you missed copying this hidden folder.

You can solve this by doing one of the following:

  1. Unzip the folder directly to where you want Flutter, or
  2. Copy the outer folder (flutter) to include all the hidden files inside, or
  3. Show all hidden files before selecting them and copying.
like image 76
Barlow Tucker Avatar answered Nov 08 '22 16:11

Barlow Tucker


I solved this by using this command:

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

(Note: make sure you have git installed.)

After that, try to open flutter_console.bat and type any flutter command to check whether it is installed properly or not.

like image 36
Anshul Verma Avatar answered Nov 08 '22 15:11

Anshul Verma


you need to run git init so that the .git folder can be created. once you do that flutter doctor will work as intended.

like image 5
ncoder83 Avatar answered Nov 08 '22 15:11

ncoder83