0

I have fresh installation of latest version of Flutter which is 1.22.6 on Windows 7 64bit Ultimate so that I can learn how to create a mobile app for Android or iOS mobile phones. I also installed Git. The flutter is located in c:\src\flutter\ recommended by Flutter.

I also updated Environment Variables so that I can run Flutter from Windows console cmd. However, both Windows console vis cmd and Flutter console via flutter_console batch file location in c:\src\flutter\ keep crashing after a brief display of some info when I run any flutter commands such as:

flutter, flutter doctor, flutter --version

etc.

I have tried to find a solution to fix the above issue, but no luck so far.

How to fix it?

desertnaut
  • 57,590
  • 26
  • 140
  • 166
daro2013
  • 33
  • 2
  • 8
  • Does this answer your question? [Error: unable to find git in your PATH on windows cmd](https://stackoverflow.com/questions/65446923/error-unable-to-find-git-in-your-path-on-windows-cmd) – Lal Krishna Jun 17 '23 at 07:06
  • Checkout the Answer in: https://stackoverflow.com/a/76495083/4061501 – Lal Krishna Jun 17 '23 at 07:08

5 Answers5

4

as ycdaskin says here: https://github.com/flutter/flutter/issues/68820

Adding powershell.exe path to system variables solved the issue for me.

C:\Windows\System32\WindowsPowerShell\v1.0

check for your version, it could be 5.0 now. works to me. good luck.

desertnaut
  • 57,590
  • 26
  • 140
  • 166
David Shandor
  • 107
  • 14
  • Thanks. I bought a new laptop with Windows 10 Home installed, there is no such issue. It is issue with Windows 7 I have on my old laptop. – daro2013 Apr 12 '21 at 15:25
1

If you are on Windows 11 just like me, adding these to Path in Environment Variables helped me.

C:\Program Files\Git\bin

C:\Program Files\Git\cmd

C:\Windows\System32

C:\Windows\System32\WindowsPowerShell\v1.0

C:\src\flutter\bin

The SysWOW folder does not exist in my C Drive. If it's a similar case for you too, this should definitely do the job.

As another user mentioned above/below, you still need to install Git.

  • In my case, I noticed adding either C:\Program Files\Git\bin or C:\Program Files\Git\cmd to path makes the cmd close. If I remove them, the cmd doesn't close on running flutter doctor but I cannot call git globally. – Quwaysim Mar 03 '23 at 08:54
0
C:\Program Files\Git\bin

C:\Program Files\Git\cmd

C:\Windows\System32

C:\Windows\SysWOW64\WindowsPowerShell\v1.0

C:\src\flutter\bin

The above path may vary according to your folder structure. But make sure that you add the paths of the above things and install git.

I've come across this problem recently and the above solution worked for me. Just give it a try, I hope it'll solve your problem too.

desertnaut
  • 57,590
  • 26
  • 140
  • 166
auro
  • 49
  • 1
  • 5
0

This simply fixed it.

  1. Install git
  2. add these to your system path:
  • C:\Program Files\Git\bin
  • C:\Program Files\Git\cmd
birigu
  • 1
-1

I just use Windows 10 instead of Windows 7 to solve the above issue. No more crash on Windows 10 and Flutter works perfectly. Many thanks.

B001ᛦ
  • 2,036
  • 6
  • 23
  • 31
daro2013
  • 33
  • 2
  • 8