Serge Breusov
Serge Breusov

Reputation: 1396

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

Upvotes: 21

Views: 21450

Answers (5)

Andi
Andi

Reputation: 11

as the green play button in toolbar runs the debug mode, i switched it to release mode via:

Upvotes: 1

Kab Agouda
Kab Agouda

Reputation: 7289

In Android Studio , click on :

> Run
> Flutter Run 'main.dart' in Release Mode

enter image description here

Upvotes: 21

James Christian Kaguo
James Christian Kaguo

Reputation: 1469

flutter build appbundle  --release --build-name=1.1.1 --build-number=3

Or you can run that in your Terminal, Remember to change build name and build number to corresponding values of your release app versioning.

Upvotes: 0

Tushar Khanna
Tushar Khanna

Reputation: 11

The best way to make your apk for release mode is that open the project -> click on the android folder then make your apk as same as generated application build in android using your .jks key and alias password and name. this is the correct way for making apk in flutter.

Upvotes: -1

boformer
boformer

Reputation: 30123

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.

Upvotes: 41

Related Questions