Cristian F. Bustos
Cristian F. Bustos

Reputation: 503

Flutter - Error: Unable to create dart snapshot for flutter tool

When I run flutter change channel or flutter doctor, the CMD show me this:

C:\Users\MyUser>flutter doctor -v
Checking Dart SDK version...

Building flutter tool...

Running pub upgrade...

/C:/src/flutter/packages/flutter_tools/lib/src/aot.dart:144:5: Warning: Must explicitly return a value from a non-void function.
    return;
    ^

When I run:

git clean -xfd

git pull

flutter doctor

The CDM show me this:

fatal: not a git repository (or any of the parent directories): .git

How can I solve it? Thank you

Upvotes: 1

Views: 6444

Answers (5)

Shibukuri
Shibukuri

Reputation: 1

unfortunately none of the given solution so far works for me..

I had to the following steps, which was the only solution for me:

  • delete the whole flutter folder
  • extract (or copy) it from the zip-file to your installation directory (in my case I just downloaded the latest flutter version, because I didn't have access to the previous downloaded zip-file anymore)
  • open the IDE in the installation directory (or open the associated project)
  • run flutter pub get

Upvotes: 0

Odair Pianta
Odair Pianta

Reputation: 1

On windows, delete flutter folder C:\Users\User\AppData\Local\Pub This is the flutter temp/cache folder and may contain outdated versions of the libraries

Upvotes: 0

asirabdelhady
asirabdelhady

Reputation: 1

I had the exact same problem yesterday, i tired to run

git clean -xfd

git pull

flutter doctor

in cmd and i kept getting:

fatal: not a git repository (or any of the parent directories): .git

eventually i gave up and i deleted the old flutter sdk directory from my PC as well as the path from Enviroment Variables and i downloded the new sdk and setup flutter again and now it's running fine

https://docs.flutter.dev/get-started/install

Upvotes: 0

Ineza
Ineza

Reputation: 147

1.Go the Flutter install directory and please run (in cmd)

git clean -xfd

git stash save --keep-index

git stash drop

git pull

2.and restart your computer then run

flutter doctor

3.then go to your project path run

flutter packages get

flutter run

Upvotes: 3

Babatunde Ahmed
Babatunde Ahmed

Reputation: 56

Had the same issue...Copied the flutter_tools from flutter download and replaced with the same folder in my installation then ran flutter doctor from command in administrator mode. Funny the issue started 3 days ago for me too.

Upvotes: 3

Related Questions