fluttervisual-studio-2022environmentwindows-11

Can`t create a Windows Flutter Desktop app, VS2022 C++ toolchain absent from "flutter doctor" output


After some time, I tried to create a Windows Flutter app. But I found out the VS2022 toolchain isn't listed on the flutter doctor output anymore:

enter image description here

So, when trying to create a new Windows Flutter app I get a message informing that my environment is unable to compile to Windows:

enter image description here

I can't say when this happened exactly, but a couple months ago I could create and run Windows apps, since I also work with the .NET stack. So I checked the VS2022 installed components for the C++ desktop development, and there's nothing wrong, or different from that time:

enter image description here

(I should add the Windows 10 SDK 10.0.20348.0, which is also installed).

flutter doctor -v don't give me any more details, also omitting any VS2022 or C++ tools I have installed:

[✓] Flutter (Channel stable, 3.22.1, on Microsoft Windows [Version 10.0.22631.3672], locale pt-BR)
    • Flutter version 3.22.1 on channel stable at C:\Users\user\.puro\envs\dev-3-22-1\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision a14f74ff3a (9 days ago), 2024-05-22 11:08:21 -0500
    • Engine revision 55eae6864b
    • Dart version 3.4.1
    • DevTools version 2.34.3

[✓] Windows Version (Installed version of Windows is version 10 or higher)

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at C:\Users\user\AppData\Local\Android\sdk
    • Platform android-34, build-tools 34.0.0
    • Java binary at: C:\Program Files\Android\Android Studio\jbr\bin\java
    • Java version OpenJDK Runtime Environment (build 17.0.9+0--11185874)
    • All Android licenses accepted.

[✓] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[✓] Android Studio (version 2023.2)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.9+0--11185874)

[✓] VS Code (version 1.89.1)
    • VS Code at C:\Users\user\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.88.0

[✓] Connected device (2 available)
    • Chrome (web) • chrome • web-javascript • Google Chrome 125.0.6422.113
    • Edge (web)   • edge   • web-javascript • Microsoft Edge 125.0.2535.67

[✓] Network resources
    • All expected network resources are available.

• No issues found!

Now I'm not working with Flutter apps on Windows, and may have to reinstall the Visual Studio (or, maybe, format my workstation and reinstall everything) if someday I really need to work on this kind of project.

My OS is Windows 11 23H2 22631.3672 and Flutter version is 3.22.1 (I use Puro as my Flutter version manager, and in previous versions of Flutter, the info about my VS2022 also disappeared. I don't think this should be any issue with the version manager, because everything worked before, but I think I could test this hypothesis, as soon as I can).

Did this happen to someone else too? Is there some workaround to fix this issue?

For now, I switched to previous Flutter versions using Puro (3.3.10. 3.7.0, 3.10.6 and 3.16.0), and in all flutter doctor outputs, the information about the VS2022 version installed was just gone too. It's weird because, under Windows, if there's some installation error with Visual Studio, I expected flutter doctor to tell what's wrong with it, but it just don't show me anything about it.


Solution

  • This looks like you disabled Windows development support using flutter config; try running flutter config --enable-windows-desktop.