简体   繁体   中英

Flutter Desktop Linux build failed

When I try to build my app to Flutter Desktop its fail with this message:

Launching lib/main.dart on Linux in debug mode...
Exception: Build process failed

My configuration is:

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel master, 1.19.0-2.0.pre.142, on Linux, locale pt_BR.UTF-8)
 
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
[✓] Linux toolchain - develop for Linux desktop
[✓] Android Studio (version 3.6)
[✓] Connected device (1 available)

Can anyone know how to fix this?

Thanks

I had the same issue.

First I ran flutter run -v -d linux , I followed the log and I noticed it an OS Error

Unhandled exception:
FileSystemException: Setting current working directory failed

So, I firstly switch to the master channel (solution for some people), run flutter upgrade and I was getting the same error.

My working dir is /home/xylia/Flutter\ Apps/github_pages and I felt it might be the space from the folder name (I had an issue like that once), so I created a new folder without space and it worked!

I am not totally sure if changing channel to master helped but there is no harm in doing it

I don't know if you already found a solution but for everyone having this problem, I solved it by doing the following:

Inside your project root directory delete the linux folder, like rm -rf linux .

Run flutter clean to delete the build folder and other related files.

Then run flutter create. to make flutter recreate your linux folder.

I had the same problem my fix was to create/run the flutter project on primary SSD/HDD drive.

In my case, it was a dependencies problem. I was trying to use svg_flutter package in a desktop app (which is not supported).

Try running flutter run -v -d linux and check if any error message corresponds with new packages that you added recently.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM