3

I have been using Flutter in Visual Studio Code.

It prompted me to flutter upgrade, and I did.

Now flutter doctor gives

Unhandled exception:
Invalid argument(s): Cannot find executable for git.
#0      _getExecutable (package:process/src/interface/local_process_manager.dart:127:5)
#1      LocalProcessManager.runSync (package:process/src/interface/local_process_manager.dart:94:30)
#2      _DefaultProcessUtils.runSync (package:flutter_tools/src/base/process.dart:417:51)
#3      _runGit (package:flutter_tools/src/version.dart:665:23)
#4      new FlutterVersion (package:flutter_tools/src/version.dart:54:26)
#5      runInContext.<anonymous closure> (package:flutter_tools/src/context_runner.dart:138:29)
...

despite git being in the path (last item [Update] no change when I moved it to the start & restarted VSC):

C:\Users\me>path   
PATH=C:\Program Files (x86)\Common Files\Oracle\Java\javapath;   
[snip]   
e:\coding\flutter\bin\mingit\cmd;  

The path is 1,876 chars long - is that still a problem in Windows 10?

and accessible:

C:\Users\me>git
usage: git [--version] [--help] [-C <path>] [-c name=value]
           [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
           [-p | --paginate | --no-pager] [--no-replace-objects] [--bare]
           [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
           <command> [<args>]

IMPORTANT: this is happening even after a total, clean, uninstall of VSC, using Revo Uninstaller Pro and reinstall.

[Update] I have added the path to flutter.bat to my path and can invoke flutter from the cmd command line. I could not find any flutter.exe.

Visual Studio Code still says that it does not recognize the command flutter

Mawg says reinstate Monica
  • 38,334
  • 103
  • 306
  • 551

2 Answers2

0

I set the environment variables FLUTTER_HOME and FLUTTER_SDK_ROOT (both to he same value) and ran flutter upgrade --force from the command line.

That seems to have done the trick somehow. Except that Flutter still can't see my Android Virtual Machines :-(

Mawg says reinstate Monica
  • 38,334
  • 103
  • 306
  • 551
0

Go to C directory, (C:\Program Files\Git\cmd) , that's if you're on windows, copy the path and paste in in your environment variables path. Restart the IDE and all should be working now.