When I tried to run Flutter app on windows, it gives an error then says Exited Sigterm. or stmh like this.
the error says;
Re-run cmake with a different source directory
cmake files does not match...
etc.
The Steps that helped me to handle this error are;
open your terminal then write following commands
flutter clean
flutter pub get
flutter run
This will remove you build file and re-create it.
Your problem should have solved now.
I was trying to do is to build Windows desktop apps with Flutter. I just followed all the steps of installation that were written in the documentation of Flutter. I just created a simple boilerplate with the command flutter create learningflutter on my Windows 11 machine. Then I just run the flutter run -d windows command inside the directory (learningflutter), then ended up with this error:
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppBuild.targets(489,26): error MSB4100: Expected "$([System.String]::new('%(Link.AdditionalDependencies)').Contains('atls.lib'))" to evaluate to a boolean instead of "$([System.String]::new('..\flutter\Debug\flutter_wrapper_app.lib;D:\My File\Documents\Much Aris'z\Work\Salesman Tracking\Code\salesman_tracking_applications\windows\flutter\ephemeral\flutter_windows.dll.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;comdlg32.lib;advapi32.lib').Contains('atls.lib'))", in condition "'$(ATL_KeyFile)' != '' and ('$(ConfigurationType)' == 'Application' or '$(ConfigurationType)' == 'DynamicLibrary') [D:\My File\Documents\Much Aris'z\Work\Salesman Tracking\Code\salesman_tracking_applications\build\windows\runner\salesman_tracking_applications.vcxproj]
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppBuild.targets(489,26): error MSB4100: and %(Link.AdditionalDependencies) != '' and $([System.String]::new('%(Link.AdditionalDependencies)').Contains('atls.lib'))". [D:\My File\Documents\Much Aris'z\Work\Salesman Tracking\Code\salesman_tracking_applications\build\windows\runner\salesman_tracking_applications.vcxproj]
Hope you found an answer, but for anyone having the same problem, I just had it and it will happen if a folder in your project's path contains a quote. If you remove that quote and delete the build folder, it will reevaluate correctly and work as expected :)
guys!
I am developing a desktop POS application for a shop. The application should have a feature to print some docs and barcodes. I have used pdf package to generate pdfs, but I am having a trouble with installing and using the priting package on Windows.
The main problem is with isntallation. In the docs, it says you should add the following lines in
CMakeLists.txt
file:
...
set(PDFIUM_VERSION "4929" CACHE STRING "" FORCE)
set(PDFIUM_ARCH "x64" CACHE STRING "" FORCE)
...
I am very confused in which CMakeLists.txt I shall put, because flutter's windows folder includes multiple files with the same name and extension. (windows\CMakeLists.txt, windows\runner\CMakeLists.txt, windows\flutter\CMakeLists.txt)
I have put the same piece of code into these different files, but none of them worked.
It always gives some errors like below:
errors
The thing I wanted to accomplish is to just print a generated PDF:
code
I'm having the same issue
What I do is
Flutter clean
Flutter pub get
Uninstall the previous application
Run the app again
And it worked
go to your terminal and type the following commands.
Flutter clean
Flutter pub get
now close the app
build the app again
hope this works for you. thanks.
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.
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 found 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 other 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 your project from the 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 was causing the error.
Followed the same approach and I was able to resolve the error very quickly.
Sometimes I get this error too. I have found that it happens whenever I forget to add a final slash "/" when declaring an assets folder in pubspec.yaml. For example:
This will produce the error:
flutter:
assets:
- assets/
- assets/game_logos
Adding the final slash solves the error:
flutter:
assets:
- assets/
- assets/game_logos/
The solution that worked for me is that I deleted build folder/dir from my project
In my case I had an assets image that I removed from the folder but had the path in pubspec.yaml, so I deleted the path then the app could run in Windows.
Removing spaces on the Projects Folder Path Solves the Issue.
Flutter Issues
I got MSB8066 when I generate python bindings, and fixed this by disabling
BUILD_PYTHON_BINDINGS in CMakeLists.txt
This can happen for a few reasons, an asset's path is missing the slash:
So:
assets:
assets/image
While it should be like this:
assets:
assets/image/
With the slash at the end.
The other more normal one, and which could really be causing such an error, could be the following;
The directory your project is in contains a special character, for example:
C:\Users\Aurélio Fernam\Documents\Projets\my_project
As you can see, "Aurélio" contains a special character. This could be causing this error.
Also try not to have a folder with space in your project path, like this:
C:\Users\Aurélio Fernam\Documents\Projets\my_project
Notice that "Aurélio Fernando/" besides having a special character, contains a space.
This could also be a trigger.
After having moved the project to a better directory, run flutter clean and run the project normally.
I faced the same issue due to some errors were there in some of the dart files. Check for red-underlined errors in the dart files you may have missed. These errors don't allow the project to run. After resolving the errors the project is running fine.
Non-Alphanumeric Characters in the project name also cause it.
I played arround with json in my asset folder. I deleted it and missed to remove it from pubspec as well.
Deleting the build folder in my project fixed the issue for me, you can also run a flutter clean, then run your project again.
In my case I use:
flutter pub get
None of the above methods worked for me.
First, I get an export zip file from project. And extract its content.
And open it, instead of the main project.
Only this worked for me after 1 day. But don't know why!
UPDATE:
This error fix for me when run Android Studio as administrator.
I'm trying to run flutter pub get from the root directory of my flutter project which is at C:\users\admin\androidstudioprojects\projectname, but I keep getting the following error:
flutter is not recognized as an internal or external command, operable
program or batch file.
However, there are no issues found when I run flutter doctor from C:\flutter.
These are the paths in my environment variables:
C:\Users\admin\AppData\Local\Programs\Python\Python38-32\Scripts\
C:\Users\admin\AppData\Local\Programs\Python\Python38-32\
C:\Users\admin\AppData\Local\Microsoft\WindowsApps
C:\Users\admin\AppData\Local\atom\bin
%USERPROFILE%\AppData\Local\Microsoft\WindowsApps
flutter\bin
C:\Program Files\Git\cmd
C:\Windows\System32
Please try adding the full path of the bin in the PATH variables that would solve it.