4

I have created a flutter project on VS, and could not run any command through VS code's terminal, I have reinstalled the VS code and still give me this error:

[X] Visual Studio - develop for Windows
X Visual Studio not installed; this is necessary for Windows development.
Download at https://visualstudio.microsoft.com/downloads/.
Please install the "Desktop development with C++" workload, including all of its default components

I have installed it again and don't know why it stays it is not installed!

Any idea how to solve it?

Thank you

1 Answers1

3

From your image; you are using Visual Studio Code, not Visual Studio.

Flutter 2.10 arrives with stable support for building Windows app, for more.

Therefore, while running flutter doctor you are able to see this error. If you've plan to build Windows app, you need to install Visual Studio with Desktop development with C++. You need to download and install Visual studio if you wish to remove this error.

You can read more about build for window here.

Md. Yeasin Sheikh
  • 54,221
  • 7
  • 29
  • 56
  • Thanks, it solved the error on the cmd, but the error on the left-hand side of the image still exists in VS code, as I still cannot run a fluter command on VS code terminal, any idea? – Ahmad Aladawi Feb 05 '22 at 14:35
  • Does it happen for all project ? – Md. Yeasin Sheikh Feb 05 '22 at 15:50
  • Yes, it does to all projects – Ahmad Aladawi Feb 05 '22 at 20:29
  • For my case, the issue was with PowerShell terminal, after setting system path and restarting the device solved my issue, you can try opening different terminal. – Md. Yeasin Sheikh Feb 06 '22 at 05:19
  • 1
    I believe the error is on Powershell/cmd terminal of VS code as well. I have run it throw a separate cmd command and it worked but the embedded cmd, PowerShell terminal on VS code is not working, the connected devices (emulators) weren't also available / connected in the VS code could you throw some light on setting the system Path? is that on the VS code settings? thanks – Ahmad Aladawi Feb 07 '22 at 22:51