Flutter Desktop Linux build failed
Asked Answered
S

4

6

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

Shoat answered 22/5, 2020 at 12:12 Comment(6)
are you trying to run the default app? Maybe the app itself is throwing some exception.Limited
@AnirudhBagri if I run on my device or in emulator its run right, only in linux desktop give this fail.Shoat
You need to run with -v to see what the build failure is, and add that to your question. There's not enough information here for anyone to be able to help you.Meanly
@Meanly I had a simlar issue as in the question asked above, here is my full ouput when I run the flutter app using: flutter -v run -d linux : pastebin.com/Cr260mZFHackman
@AtulGopinathan I am getting the same error message, have you managed to find a solution yet?Fortuitism
@Fortuitism Unfortunately, no. But if try to create a new flutter project and run the same command there, it finishes the build without any issues.Hackman
C
1

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

Cutlass answered 14/7, 2020 at 16:9 Comment(0)
A
1

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.

Alexi answered 4/3, 2021 at 17:42 Comment(0)
F
0

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

Ferment answered 16/8, 2020 at 13:45 Comment(0)
D
0

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.

Disconsolate answered 2/9, 2020 at 7:9 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.