Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Exception: No Linux desktop project configured error on flutter project

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

Running "flutter pub get" in project...
    Launching lib/main.dart on Linux in debug mode...
    Exception: No Linux desktop project configured. See https://github.com/flutter/flutter/wiki/Desktop-shells#create to learn about adding Linux support to a project.

My configuration is:

flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel master, 1.20.0-3.0.pre.126, on Linux, locale en_US.UTF-8)
 
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.0)
[✓] Chrome - develop for the web
[✓] Linux toolchain - develop for Linux desktop
[✓] Android Studio (version 4.0)
[✓] Connected device (3 available)

• No issues found!
like image 683
rvndsngwn Avatar asked Jul 04 '20 18:07

rvndsngwn


People also ask

How do I enable my desktop on flutter?

Add desktop support to an existing Flutter app$ flutter create --platforms=windows,macos,linux . This adds the necessary desktop files and directories to your existing Flutter project. To add only specific desktop platforms, change the platforms list to include only the platform(s) you want to add.

How do I add a platform to my flutter project?

flutter create . You can simply run this from the root of your Flutter project and it will add the required files for all platforms. If you only want to add support for specific enabled platforms, you can do that by supplying the --platforms argument: flutter create --platforms=web,macos .


1 Answers

While run Desktop App Error enter image description here

solution:

To add desktop support to an existing Flutter project, run the following command in a terminal from the root project directory:

enter image description here

Here we add full desktop support

flutter create --platforms=windows,macos,linux .

Only need windows

flutter create --platforms=windows .

Only need Linux

flutter create --platforms=Linux .

Tip:

To create a new application that includes desktop support (in addition to mobile and web support), run the following commands, substituting myapp with the name of your project:

flutter create myapp
cd myapp

For more Information : flutter.dev/desktop

like image 144
lava Avatar answered Sep 20 '22 18:09

lava