Flutter in VS Code command pallete doesn't find git

how to run emulator in visual studio code
how to run flutter app in vs code
vs code flutter extension
dart devtools vscode
flutter visual studio 2019
flutter inspector vscode
flutter sdk
visual studio code flutter emulator

I've been trying to setup Flutter on my laptop without success. The problem is most likely in the extensions or something in VS Code. I can run flutter commands from Powershell no problem. But the commands executed from the VS Code command palette report this:

[flutter] flutter doctor -v
'where' is not recognized as an internal or external command,
operable program or batch file.
Error: Unable to find git in your PATH. 
exit code 1

Which is weird, I do have git in my computer setup to work directly from Powershell as well - it's in PATH. Also the GIT commands from VS Code available in the command palette work no problem.

Every log I've been able to check reports the above message or just the "where" part.

Please help, if you need any additional information, I'll gladly provide it. Thank you :)

Edit #1: Flutter doctor generates a crash now. It worked before, but now it's reporting errors. This is the log it generates:

```
Flutter crash report; please file at https://github.com/flutter/flutter/issues.

## command

flutter doctor

## exception

ArgumentError: Invalid argument(s): Cannot find executable for where.

```
#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      _WindowsUtils._which (package:flutter_tools/src/base/os.dart:239:49)
#3      OperatingSystemUtils.whichAll (package:flutter_tools/src/base/os.dart:52:43)
#4      AndroidSdk.locateAndroidSdk.findAndroidHomeDir (package:flutter_tools/src/android/android_sdk.dart:336:38)
#5      AndroidSdk.locateAndroidSdk (package:flutter_tools/src/android/android_sdk.dart:360:53)
#6      AppContext._generateIfNecessary.<anonymous closure> (package:flutter_tools/src/base/context.dart:100:41)
#7      _LinkedHashMapMixin.putIfAbsent (dart:collection-patch/compact_hash.dart:293:23)
#8      AppContext._generateIfNecessary (package:flutter_tools/src/base/context.dart:88:20)
#9      AppContext.get (package:flutter_tools/src/base/context.dart:117:32)
#10     AppContext.get (package:flutter_tools/src/base/context.dart:115:23)
#11     AppContext.get (package:flutter_tools/src/base/context.dart:115:23)
#12     androidSdk (package:flutter_tools/src/android/android_sdk.dart:19:38)
#13     AndroidWorkflow.canListDevices (package:flutter_tools/src/android/android_workflow.dart:45:41)
#14     AndroidDevices.canListAnything (package:flutter_tools/src/android/android_device.dart:62:47)
#15     DeviceManager.canListAnything.<anonymous closure> (package:flutter_tools/src/device.dart:148:80)
#16     Iterable.any (dart:core/iterable.dart:388:15)
#17     DeviceManager.canListAnything (package:flutter_tools/src/device.dart:148:33)
#18     _DefaultDoctorValidatorsProvider.validators (package:flutter_tools/src/doctor.dart:90:25)
#19     Doctor.validators (package:flutter_tools/src/doctor.dart:145:46)
#20     Doctor.startValidatorTasks (package:flutter_tools/src/doctor.dart:151:39)
#21     Doctor.diagnose (package:flutter_tools/src/doctor.dart:252:41)
#22     DoctorCommand.runCommand (package:flutter_tools/src/commands/doctor.dart:59:39)
#23     FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:615:18)
#24     _asyncThenWrapperHelper.<anonymous closure> (dart:async-patch/async_patch.dart:73:64)
#25     _rootRunUnary (dart:async/zone.dart:1134:38)
#26     _CustomZone.runUnary (dart:async/zone.dart:1031:19)
#27     _FutureListener.handleValue (dart:async/future_impl.dart:139:18)
#28     Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:680:45)
#29     Future._propagateToListeners (dart:async/future_impl.dart:709:32)
#30     Future._completeWithValue (dart:async/future_impl.dart:524:5)
#31     Future._asyncComplete.<anonymous closure> (dart:async/future_impl.dart:554:7)
#32     _rootRun (dart:async/zone.dart:1126:13)
#33     _CustomZone.run (dart:async/zone.dart:1023:19)
#34     _CustomZone.runGuarded (dart:async/zone.dart:925:7)
#35     _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:965:23)
#36     _microtaskLoop (dart:async/schedule_microtask.dart:43:21)
#37     _startMicrotaskLoop (dart:async/schedule_microtask.dart:52:5)
#38     _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:118:13)
#39     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:175:5)
```

## flutter doctor

```
encountered exception: Invalid argument(s): Cannot find executable for where.

#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      _WindowsUtils._which (package:flutter_tools/src/base/os.dart:239:49)
#3      OperatingSystemUtils.whichAll (package:flutter_tools/src/base/os.dart:52:43)
#4      AndroidSdk.locateAndroidSdk.findAndroidHomeDir (package:flutter_tools/src/android/android_sdk.dart:336:38)
#5      AndroidSdk.locateAndroidSdk (package:flutter_tools/src/android/android_sdk.dart:360:53)
#6      AppContext._generateIfNecessary.<anonymous closure> (package:flutter_tools/src/base/context.dart:100:41)
#7      _LinkedHashMapMixin.putIfAbsent (dart:collection-patch/compact_hash.dart:293:23)
#8      AppContext._generateIfNecessary (package:flutter_tools/src/base/context.dart:88:20)
#9      AppContext.get (package:flutter_tools/src/base/context.dart:117:32)
#10     AppContext.get (package:flutter_tools/src/base/context.dart:115:23)
#11     androidSdk (package:flutter_tools/src/android/android_sdk.dart:19:38)
#12     AndroidWorkflow.canListDevices (package:flutter_tools/src/android/android_workflow.dart:45:41)
#13     AndroidDevices.canListAnything (package:flutter_tools/src/android/android_device.dart:62:47)
#14     DeviceManager.canListAnything.<anonymous closure> (package:flutter_tools/src/device.dart:148:80)
#15     Iterable.any (dart:core/iterable.dart:388:15)
#16     DeviceManager.canListAnything (package:flutter_tools/src/device.dart:148:33)
#17     _DefaultDoctorValidatorsProvider.validators (package:flutter_tools/src/doctor.dart:90:25)
#18     Doctor.validators (package:flutter_tools/src/doctor.dart:145:46)
#19     Doctor.startValidatorTasks (package:flutter_tools/src/doctor.dart:151:39)
#20     Doctor.diagnose (package:flutter_tools/src/doctor.dart:252:41)
#21     _doctorText.<anonymous closure> (package:flutter_tools/runner.dart:205:26)
#22     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:146:29)
#23     _rootRun (dart:async/zone.dart:1126:13)
#24     _CustomZone.run (dart:async/zone.dart:1023:19)
#25     _runZoned (dart:async/zone.dart:1518:10)
#26     runZoned (dart:async/zone.dart:1465:12)
#27     AppContext.run (package:flutter_tools/src/base/context.dart:145:18)
#28     _doctorText (package:flutter_tools/runner.dart:204:19)
#29     _createLocalCrashReport (package:flutter_tools/runner.dart:182:32)
#30     _handleToolError (package:flutter_tools/runner.dart:138:31)
<asynchronous suspension>
#31     run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:68:22)
<asynchronous suspension>
#32     _rootRun (dart:async/zone.dart:1126:13)
#33     _CustomZone.run (dart:async/zone.dart:1023:19)
#34     _runZoned (dart:async/zone.dart:1518:10)
#35     runZoned (dart:async/zone.dart:1502:12)
#36     run.<anonymous closure> (package:flutter_tools/runner.dart:61:18)
<asynchronous suspension>
#37     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:146:29)
#38     _rootRun (dart:async/zone.dart:1126:13)
#39     _CustomZone.run (dart:async/zone.dart:1023:19)
#40     _runZoned (dart:async/zone.dart:1518:10)
#41     runZoned (dart:async/zone.dart:1465:12)
#42     AppContext.run (package:flutter_tools/src/base/context.dart:145:18)
#43     runInContext (package:flutter_tools/src/context_runner.dart:64:24)
#44     run (package:flutter_tools/runner.dart:50:10)
#45     main (package:flutter_tools/executable.dart:65:9)
#46     main (file:///C:/b/s/w/ir/k/archive/flutter/packages/flutter_tools/bin/flutter_tools.dart:8:3)
#47     _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:305:32)
#48     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:174:12)
```

    
				

I had the same problem when I upgraded to flutter 1.19.0-3 and I solved it. This issue is likely caused by the "path variable", I suggest you make sure that your path contains all of the following routes. 'system32, Git bin, flutter bin and powershell'. If you are using Windows, these routes are usually the following, so you can copy the following lines into your 'path variable'.

C:\Windows\System32;
C:\Program Files\Git\bin
C:\flutter\bin;
%systemroot%\System32\WindowsPowerShell\v1.0\;
%SystemRoot%\system32;%SystemRoot%;

Visual Studio Code, How to develop Flutter apps in Visual Studio Code. Open the Command Palette ( Ctrl + Shift + P ( Cmd + Shift + P on macOS)). If you want to try running your app on the web, but the Chrome (web) target doesn't appear in the list of targets,� The problem is most likely in the extensions or something in VS Code. I can run flutter commands from Powershell no problem. But the commands executed from the VS Code command palette report this: [flutter] flutter doctor -v 'where' is not recognized as an internal or external command, operable program or batch file.

Install git desktop on to your computer and restart your IDE.

Install and run DevTools from VS Code, Once the debug session is active and the application has started, the Dart: Open DevTools command becomes available in the VS Code command palette:. In VS Code you have to go to View > Command Palette and then start typing flutter. Choose Flutter: New Project when it shows up in the list. I have to say, that was not intuitively obvious.

So, what I was missing C:\Windows\System32 value from my PATH variable. I had the Powershell in my PATH but not System32. To get Flutter working you need both.

My advice to anyone having a similar error is, check the default values of the PATH variable and set them back :)

not show Flutter: Run Flutter Doctor in VS Code � Issue #15107 , Steps to Reproduce I just did about the document, https://flutter.io/get-started/ editor/ Invoke View>Command Palette… Type 'doctor', and select� Flutter — Visual Studio Code Shortcuts for Fast and Efficient Development. Show Command Palette. in case the menu doesn’t popup you can type Ctrl+space after typing the prefix.

Device not showing up in VSCode, but detected in flutter � Issue , If I have VSCode running and plug in an iOS device, VSCode doesn't detect it unless I run the Flutter Doctor (from VSCode command palette) If you want to run apps on external device connect it with a laptop or desktop and for android developer mode need to be on. You will find that Visual Studio code automatically tries to detect the external device you can see in the following screenshot that visual studio code detected my device. Please see bottom of visual studio code.

Flutter — Visual Studio Code Shortcuts for Fast and Efficient , Or you can also use Ctrl+Shift+P to Show Command Palette with the shortcut list from here and flutter vs code extension documentation. in case the menu doesn't popup you can type Ctrl+space after typing the prefix. Start a debug session for your application by opening the root folder of your project (the one containing pubspec.yaml) in VS Code and clicking Run > Start Debugging (F5). Launch DevTools. Once the debug session is active and the application has started, the Dart: Open DevTools command becomes available in the VS Code command palette:

Moving to Visual Studio Code from Android Studio, Android Studio by comparison is much heavier, and while it doesn't take In VS Code you have to go to View > Command Palette and then� Warning: If VS Code was running during your initial Flutter setup, you may need to restart it for VS Code’s Flutter plugin to detect the Flutter SDK. Tip: The code for your app is in lib/main.dart. For a high-level description of what each code block does, see the comments at the top of that file. Run the app. Locate the VS Code status bar

Comments
  • Yes, this is what I've commented in my solution. I was for some reason missing the 1st line (in your case). Interesting how an updated messed that up.
  • I've done as you asked. Still not working. I have git working from any other terminal, except VSCode Flutter tasks.
  • Have you checked git path in environment variables ?
  • Yes, it is there. I've explicitly set path to git.exe in VSCode as well, but that changed nothing. The PATH has to point to the "bin" directory in Git, correct?
  • Yeah you are correct. And you can use android studio or intelj as a IDE
  • I have not yet tried it. I will later on today and report back.