Reputation: 1396
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
Reputation: 11
as the green play button in toolbar runs the debug mode, i switched it to release mode via:
Right click Play Icon in toolbar -> Customize Toolbar
click "+", chose Add Action
Delete the old Play button by selecting it and click "-"
Upvotes: 1
Reputation: 7289
In Android Studio , click on :
>
Run
>
Flutter Run 'main.dart' in Release Mode
Upvotes: 21
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
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
Reputation: 30123
You have to edit the run configuration:
Open the run configuration:
Add the --release
flag:
Note that using the --release
flag is not supported when you build with the Android Emulator.
Upvotes: 41