Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

flutter for Desktop, Visual Studio 2022 problem

i get this message when try to run flutter application on the Windows,

Building Windows application...
CMake Error at CMakeLists.txt:2 (project):
  Generator

    Visual Studio 16 2019

  could not find any instance of Visual Studio.

i have installed Visual Studio 2022 with many tools like in the image below enter image description here

and this what I got from Flutter Doctor:
E:\mp\my_class>flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel beta, 2.8.0-3.2.pre, on Microsoft Windows [Version 10.0.22000.318], locale en-US)
[√] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
[√] Chrome - develop for the web
[√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.0.2)
[√] Android Studio (version 2020.3)
[√] IntelliJ IDEA Ultimate Edition (version 2021.2)
[√] VS Code (version 1.62.3)
[√] Connected device (3 available)

• No issues found!
like image 786
Osama Mohammed Avatar asked Jun 30 '26 05:06

Osama Mohammed


2 Answers

Visual Studio 2022 is only supported in version 2.9 or later (which at the time of writing is only on the master channel). The fact that doctor doesn't show any indication that 2022 won't work is a bug.

like image 60
smorgan Avatar answered Jul 03 '26 00:07

smorgan


this problem has been solved by just uninstalling Visual Studio 2022 with its components, and reinstalling Visual Studio 2019 version 16 as shown in the error message, and now it is working !!! , actually, someone answered this solution, but he seems removed his answer ....by the way, thank you

like image 36
Osama Mohammed Avatar answered Jul 03 '26 00:07

Osama Mohammed



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!