Flutter How to make release version in Android Studio?

Serge Breusov picture Serge Breusov · Jun 23, 2018 · Viewed 9.3k times · Source

By default Android Studio use debug mode when building Flutter application. You can build the release version with the command line, see How to optimize the Flutter App size?

    flutter build apk --release

Now: how to configure Android Studio to do the same, when I run the application (Shift+F10)? I can't find this setting...

Answer

boformer picture boformer · Jun 23, 2018

You have to edit the run configuration:

Open the run configuration:

Open the run configuration

Add the --release flag:

Add the --release flag

Note that using the --release flag is not supported when you build with the Android Emulator.