Reputation: 581
My Flutter Doctor is saying:
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.
How can I fix this problem?
Upvotes: 53
Views: 195652
Reputation: 39
You need to install Visual Studio. This is different to Visual Studio Code.
https://visualstudio.microsoft.com/downloads/
Ensure that you select 'Desktop development with C++' and probably 'Mobile development with C++'
Upvotes: 0
Reputation: 51
Also You Install the Visual Studio Desktop development with C++
You could also get desktop development with the C++ tool after installing Visual Studio and then navigating to tool → Get tools and features → Desktop development with C++.
Upvotes: 1
Reputation: 135
To build Windows application (exe file), you don't need install Visual Studio IDE. You can only install Visual Studio Build Tools.
When installing it, remember to select the required package Desktop development with C++ similar when install Visual Studio IDE.
Upvotes: 6
Reputation: 1168
I even had already installed VS2022 and encountered this error.
I had to add this line to graalvm-jdk-21.0.1+12.1\bin\native-image.bat
@echo off
call "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat" > nul
Upvotes: 0
Reputation: 783
Is unnecessary to install the "Desktop development with C++" if you don't want to develop desktop applications for Windows using Flutter.
If you only want to develop mobile apps using Flutter, you can run
flutter config --no-enable-windows-desktop
to disable the desktop support for your Flutter projects. After that, when you run the flutter doctor
command again, you will no longer see the warning.
Read more at: https://fig.io/manual/flutter/config
Upvotes: 62
Reputation: 121
With the newest android installer "android-studio-2022.1.1.19-windows" there would be a jbr and jre folder existing, hence creating a link from jre to jbr would not work.
What you can do is copy the contents of the items in jbr into the jre folder and this would resolve the error.
Upvotes: 0
Reputation: 9851
My solution was a bit simpler. Uninstall everything all build system's from VS. Then reinstall Visual Studio Community 2022, restart then try again. Might get a warning about nuget but it should fix the issue.
Upvotes: 0
Reputation: 11
Only two steps are required.
Install Visual Studio 2022 (Link: https://visualstudio.microsoft.com/downloads/)
Install Visual Studio Code (Link: https://code.visualstudio.com/)
Your code will run smoothly.
Upvotes: 0
Reputation: 379
The error means install Visual Studio, and this is different from Visual Studio Code. It's an IDE from Microsoft.
For those who may be using a weak computer and can't afford to install the full Visual Studio, you only need to install a few components from Visual Studio to get Flutter to run on your computer without errors. These components are:
In total, they should occupy around 8 GB or so.
Upvotes: 18
Reputation: 11
Make sure to install Visual Studio Code.
Open the Visual Studio download page:
Upvotes: -2
Reputation: 3720
It's basically saying that if you want to develop your Flutter application for Windows you will need to install Visual Studio 2022 and while installing Visual Studio 2022 you will need to download this: Desktop development with C++
Also, you have to install the third link in this: Visual-studio
You could also get desktop development with the C++ tool after installing Visual Studio and then navigating to tool → Get tools and features → Desktop development with C++.
Upvotes: 63
Reputation: 1487
As it states, you need to download Visual Studio (which is different from Visual Studio Code).
When installing it, remember to select the required package Desktop development with C++
:
This will not prevent you from developing Mobile apps, but it's a requirement only for Windows Development.
Upvotes: 10