flutter doctor
and get the following Visual Studio-related error message:
[√] Flutter (Channel master, v1.10.15-pre.405, on Microsoft Windows [Version 10.0.18362.418], locale en-US)
• Flutter version 1.10.15-pre.405 at c:\Users\csell\flutter
• Framework revision 28b5cc3825 (4 hours ago), 2019-11-05 11:50:30 +0100
• Engine revision 7b968ff95f
• Dart version 2.7.0
[√] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
• Android SDK at C:\Users\csell\AppData\Local\Android\sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-29, build-tools 29.0.2
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)
• All Android licenses accepted.
[!] Visual Studio - develop for Windows (Visual Studio Community 2019 16.3.7)
• Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community
• Visual Studio Community 2019 version 16.3.29424.173
X Visual Studio is missing necessary components. Please re-run the Visual Studio installer for the "Desktop development with C++" workload, and include these components:
MSBuild
MSVC v142 - VS 2019 C++ x64/x86 build tools
- If there are multiple versions, install the latest one
Windows 10 SDK (10.0.17763.0)
[!] Android Studio (version 3.5)
• Android Studio at C:\Program Files\Android\Android Studio
X Flutter plugin not installed; this adds Flutter specific functionality.
X Dart plugin not installed; this adds Dart specific functionality.
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)
[√] VS Code (version 1.39.2)
• VS Code at C:\Users\csell\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.5.1
[√] Connected device (1 available)
• Windows • Windows • windows-x64 • Microsoft Windows [Version 10.0.18362.418]
! Doctor found issues in 2 categories.
Running the x64 Native Tools Command Prompt for VS 2019 cmd prompt makes the various MSVC tools available on the command line, e.g. msbuild, but does not appease flutter doctor
.
Your screenshot shows the required SDK version as unselected, so you are missing one of the required components listed by doctor
Apparently in VS 2019 it's now possible to just set the version to "10.0" instead of an exact version, which wasn't possible when I was initially researching this. We may want to require 2019 so that we can switch to that, since this has been, and will continue to be, a pain point.
how do I fix the issue?
You need to install the component called "Windows 10 SDK (10.0.17763.0)"
Unfortunately there doesn't appear to be a generic component ID for "latest SDK" so even if we set it to 10.0 and required VS 2019 doing the vswhere
query would be very messy, and require tool updates for every Windows SDK release.
Then the bug is that flutter doctor
says to do two things:
The line about installing the latest goes with the build tools, not the SDK. That's supposed to be clear from formatting but the indentation looks like it's messed up.
We should fix the indentation, and explicitly mention build tools again in that line so that confusion can't happen regardless of indentation.
Closing since the text was improved to help avoid this confusion. #50487 tracks trying to eliminate the need for a specific SDK version entirely which would avoid this common problem.
Most helpful comment
You need to install the component called "Windows 10 SDK (10.0.17763.0)"