0
votes

I am getting this error while building for windows

C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(238,5): error MSB8066: Custom build for 'D:\DSI projects\sanjali_app\build\windows\CMakeFiles\a6c8cc86bdf940a07f4885a881770ba0\flutter_windows.dll.rule;D:\DSI projects\sanjali_app\build\windows\CMakeFiles\9c479cc21d461e620769ab96f5bca778\flutter_assemble.rule' exited with code 1. [D:\DSI projects\sanjali_app\build\windows\flutter\flutter_assemble.vcxproj] Exception: Build process failed.

3

3 Answers

0
votes

Removing spaces on the Projects Folder Path Solves the Issue.

Flutter Issues

0
votes

I got MSB8066 when I generate python bindings, and fixed this by disabling BUILD_PYTHON_BINDINGS in CMakeLists.txt

0
votes

Updated Aug 2021

Faced the same error for couple of hours, and none of the issue on Github or answer on StackOverflow seems to be working for me.

So after my research i find out that, There is no specific reason why Error MSB8066 error occur, but it can be due to space in your project Folder path as mentioned by @aishamhasan or some undetermined reason, In my case, there is a simple file that is missing

Error detected in pubspec.yaml:
[   +2 ms]   [        ] No file or variants found for asset: images/project_app.png.

In order to quickly find out what causing this problem you can run you project from command line instead of using run functionality on android studio.

flutter run -d windows -v

And inside your verbose lookout for any error or you can directly search for Error and then try to figure out what causing Error.

Followed the same approach and able to resolve the error very quickly.