android-studioflutterapkreleaserelease-management

Flutter How to make release version in Android Studio?


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...


Solution

  • 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.