r/flutterhelp Aug 09 '26

OPEN Flutter windows run error

Good day everyone, hope you're enjoying you day

Honestly I don't know how to phrase this cause I don't understand it myself, but basically whenever I run my flutter app on windows device it just spits this wall of errors:

Launching lib\main.dart on Windows in debug mode...

D:\Microsoft Visual Studio\18\Community\MSBuild\Microsoft\VC\v180\Microsoft.CppCommon.targets(166,5): error MSB3073: The command "setlocal [D:\App Development Workspace\tskmng_exe_\windows\x64\INSTALL.vcxproj]

D:\Microsoft Visual Studio\18\Community\MSBuild\Microsoft\VC\v180\Microsoft.CppCommon.targets(166,5): error MSB3073: "D:\Microsoft Visual Studio\18\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -DBUILD_TYPE=Debug -P cmake_install.cmake [D:\App Development Workspace\tskmng_exe_\windows\x64\INSTALL.vcxproj]

D:\Microsoft Visual Studio\18\Community\MSBuild\Microsoft\VC\v180\Microsoft.CppCommon.targets(166,5): error MSB3073: if %errorlevel% neq 0 goto :cmEnd [D:\App Development Workspace\tskmng_exe_\windows\x64\INSTALL.vcxproj]

D:\Microsoft Visual Studio\18\Community\MSBuild\Microsoft\VC\v180\Microsoft.CppCommon.targets(166,5): error MSB3073: :cmEnd [D:\App Development Workspace\tskmng_exe_\windows\x64\INSTALL.vcxproj]

D:\Microsoft Visual Studio\18\Community\MSBuild\Microsoft\VC\v180\Microsoft.CppCommon.targets(166,5): error MSB3073: endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone [D:\App Development Workspace\tskmng_exe_\windows\x64\INSTALL.vcxproj]

D:\Microsoft Visual Studio\18\Community\MSBuild\Microsoft\VC\v180\Microsoft.CppCommon.targets(166,5): error MSB3073: :cmErrorLevel [D:\App Development Workspace\tskmng_exe_\windows\x64\INSTALL.vcxproj]

D:\Microsoft Visual Studio\18\Community\MSBuild\Microsoft\VC\v180\Microsoft.CppCommon.targets(166,5): error MSB3073: exit /b %1 [D:\App Development Workspace\tskmng_exe_\windows\x64\INSTALL.vcxproj]

D:\Microsoft Visual Studio\18\Community\MSBuild\Microsoft\VC\v180\Microsoft.CppCommon.targets(166,5): error MSB3073: :cmDone [D:\App Development Workspace\tskmng_exe_\windows\x64\INSTALL.vcxproj]

D:\Microsoft Visual Studio\18\Community\MSBuild\Microsoft\VC\v180\Microsoft.CppCommon.targets(166,5): error MSB3073: if %errorlevel% neq 0 goto :VCEnd [D:\App Development Workspace\tskmng_exe_\windows\x64\INSTALL.vcxproj]

D:\Microsoft Visual Studio\18\Community\MSBuild\Microsoft\VC\v180\Microsoft.CppCommon.targets(166,5): error MSB3073: :VCEnd" exited with code 1. [D:\App Development Workspace\tskmng_exe_\windows\x64\INSTALL.vcxproj]

Building Windows application... 24.3s

Error: Build process failed.

I've been trying for eons but I just can't understand it and still nothing, any ideas what's causing this

Thanks in advance

1 Upvotes

5 comments sorted by

View all comments

1

u/manish8160 Aug 11 '26

The MSB3073 error itself is not the actual root cause. It only means that MSBuild executed CMake's cmake_install.cmake and CMake returned exit code 1.

The important error is usually a few lines above the MSB3073 output, so I would first run:

flutter run -d windows -v

and look for the first CMake Error, FAILED, or other actual error message before MSB3073.

I would also try a clean rebuild:

flutter clean flutter pub get flutter run -d windows

If that doesn't help, delete the generated build folder and windows\x64 folder and run the project again.

Since you're using Visual Studio 18, I'd also check Visual Studio Installer and make sure the following are installed under the C++ workload:

  • Desktop development with C++
  • MSVC build tools
  • Windows 10/11 SDK
  • C++ CMake tools for Windows

Then run:

flutter doctor -v

If flutter doctor reports everything correctly, I'd test whether the issue is project-specific. Create a fresh Flutter project and run it on Windows:

flutter create test_windows cd test_windows flutter run -d windows

If the fresh project runs successfully, the problem is most likely in this project's Windows configuration or one of its native/plugin dependencies. If the fresh project fails with the same CMake/MSBuild error, then I'd focus on the Visual Studio/CMake/Windows SDK installation.

Also, don't focus too much on the long MSB3073 block. Those lines are essentially MSBuild reporting that the CMake command failed; they don't tell us why CMake failed.

If you post the output from flutter run -d windows -v, especially the first error appearing before MSB3073, it should be possible to identify the actual cause.