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

  • are you trying to run the default app? Maybe the app itself is throwing some exception. – Anirudh Bagri May 22 '20 at 12:58
  • @AnirudhBagri if I run on my device or in emulator its run right, only in linux desktop give this fail. – Jacques Marques May 23 '20 at 12:58
  • 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. – smorgan May 23 '20 at 15:51
  • 1
    @smorgan 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` : https://pastebin.com/Cr260mZF – Atul Gopinathan Jul 09 '20 at 08:17
  • @AtulGopinathan I am getting the same error message, have you managed to find a solution yet? – matkv Jul 18 '20 at 19:28
  • @matkv Unfortunately, no. But if try to create a new flutter project and run the same command there, it finishes the build without any issues. – Atul Gopinathan Jul 19 '20 at 02:17

4 Answers4

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

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.

Gabriel Pacheco
  • 309
  • 3
  • 10
0

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

Mr Random
  • 1,992
  • 7
  • 20
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.

jsgalarraga
  • 425
  • 6
  • 13