1

I want to conveniently develop Desktop applications using Flutter & Android Studio. Currently Flutter Desktop Apps run only on the master channel.

I'm able to flawlessly enable MacOS as a flutter device with export ENABLE_FLUTTER_DESKTOP=true where my macos laptop shows as the following device:

$ flutter devices
1 connected device:

macOS • macOS • darwin-x64 • Mac OS X 10.14.5 18F132

I can launch the app directly on desktop with flutter run

Which Run/Debug configuration should I choose to automatically build & launch Flutter app from Android Studio?

Flutter ver. Channel master, v1.9.8-pre.108

EDIT: as @smorgan correctly suggested, just run: flutter config --enable-macos-desktop

enter image description here Remember that you also need to have macos build target in your app workspace:

enter image description here

1 Answer 1

4

You should not use ENABLE_FLUTTER_DESKTOP; any instructions referencing it are out of date. You should instead run flutter config --enable-macos-desktop as described in the official documentation.

That approach will enable desktop support everywhere, including Android Studio, rather than just the current terminal. Once you do that, normal Flutter workflows in Android Studio will work for desktop.

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks, running flutter config --enable-macos-desktop and restarting Android Studio is enough to develop for desktop supposing that the project already has macos build target.
Running flutter create . after flutter config --enable-...-desktop fixed it for me.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.