hema
hema

Reputation: 11

Why I am getting this Program 'flutter.bat' failed to run: The system cannot find the file specifiedAt line:1 char:1

enter image description here

I am trying to create a flutter application in Visual Studio code which raising the above error.

enter image description here

Upvotes: 0

Views: 3509

Answers (6)

Angkon Debnath
Angkon Debnath

Reputation: 11

  1. Check the path of the ComSpec. Is it C:\WINDOWS\system32\cmd.exe or not. I faced the same problem like you and solved it by editing the ComSpec path.

  2. Add the flutter bin path correcly. And then follow the others steps like flutter doctor / flutter doctor --android-licenses. for the licenses type Y everytime.

Upvotes: 1

Answertool
Answertool

Reputation: 1

it seems that you installed git in correctly uninstall git and than install correctly. when you installing it select the options (use git and optional unix tools from the windows command prompt)

Upvotes: 0

Hydro
Hydro

Reputation: 1

This may be because your cmd.exe file located in system32 has been corrupted or lost. Try to get the cmd.exe file from another system and paste it into the desired location then execute if there is a flutter in your system or not. This has solved the problem in my case.

Upvotes: -1

Maruf Hassan
Maruf Hassan

Reputation: 1238

Since you have installed Flutter for the first time, you need to accept Android License to start building with Flutter.

To accept the license,

  1. Open the terminal
  2. Type flutter doctor --android-licenses
  3. Press y to accept every license.

Upvotes: 0

ronronks
ronronks

Reputation: 1

it seems you have not accepted all android licenses. try reinstalling android SDK and make sure to accept all android licenses. then run

flutter doctor

and see if it passes all checks

Upvotes: 0

Ashish Shetty
Ashish Shetty

Reputation: 1

Sound to me like you have not installed flutter SDK properly or VS code is having problems finding the SDk path. it can be any of those things.

Upvotes: 0

Related Questions