Error while compiling for Flutter Desktop

3.3k Views Asked by At

unable to compile my application for windows desktop.

`Microsoft Windows [version 10.0.17134.1246] (c) 2018 Microsoft Corporation. Tous droits réservés.

C:\Users\CREATIVE'S DEV\AndroidStudioProjects\flutter_app>flutter run -d windows Launching lib\main.dart on Windows in debug mode... CMake Error at C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/Comm onExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/CMakeTestCXXCompiler.cmake:53 (me ssage): The C++ compiler

"C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.27.29110/

bin/Hostx64/x64/cl.exe"

is not able to compile a simple test program.

It fails with the following output:

Change Dir: C:/Users/CREATIVE'S DEV/AndroidStudioProjects/flutter_app/build/windows/CMake

Files/CMakeTmp

Run Build Command(s):C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/MSBuil

d/Current/Bin/MSBuild.exe cmTC_4a34b.vcxproj /p:Configuration=Debug /p:Platform=x64 /p:Visual StudioVersion=16.0 /v:m && Microsoft (R) Build Engine version 16.7.0+b89cb5fde pour .NET Fram ework Copyright (C) Microsoft Corporation. Tous droits réservés.

C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Microso

ft.Common.CurrentVersion.targets(5677,7): error MSB4023: Impossible d'évaluer la métadonnée d 'élément "%(FullPath)". Impossible d'appliquer la métadonnée d'élément "%(FullPath)" au chemi n d'accès "@(_DebugSymbolsIntermediatePath->'C:\Users\CREATIVE'S DEV\AndroidStudioProjects\fl utter_app\build\windows\CMakeFiles\CMakeTmp\Debug%(Filename)%(Extension)')". Caractères non conformes dans le chemin d'accès. [C:\Users\CREATIVE'S DEV\AndroidStudioProjects\flutter_app
build\windows\CMakeFiles\CMakeTmp\cmTC_4a34b.vcxproj]

CMake will not be able to correctly generate this project. Call Stack (most recent call first): CMakeLists.txt:2 (project)

Building Windows application... Exception: Unable to generate build files `

3

There are 3 best solutions below

0
On

Caractères non conformes dans le chemin d'accès.

Try moving your project to a path that doesn't have a ' in it.

0
On

I solved the problem by installing flutter via snap

sudo snap install flutter --classic

then do that and it's good

sudo apt-get install clang cmake ninja-build pkg-config libgtk-3-dev
0
On

if you installed 360safeenter image description here,you can try uninstall it, and run flutter clean, delete window folder, run flutter create . to fix it.