Build and release an Android app

Signing the app

To publish on the Play Store, you need to give your app a digital signature. Use the following instructions to sign your app.

Create a keystore

If you have an existing keystore, skip to the next step. If not, create one by running the following at the command line:

On Mac/Linux, use the following command:

keytool -genkey -v -keystore ~/key.jks -keyalg RSA -keysize 2048 -validity 10000 -alias key

On Windows, use the following command:

keytool -genkey -v -keystore c:\Users\USER_NAME\key.jks -storetype JKS -keyalg RSA -keysize 2048 -validity 10000 -alias key

This command stores the key.jks file in your home directory. If you want to store it elsewhere, change the argument you pass to the -keystore parameter. However, keep the keystore file private; don’t check it into public source control!

Reference the keystore from the app

Go to <app dir>/android/key.properties change your keystore reference:

Building the app for release

command line for appbundle:

  1. Enter cd <app dir> (Replace <app dir> with your application’s directory.)

  2. flutter build appbundle --release

The release bundle for your app is created at <app dir>/build/app/outputs/bundle/release/app.aab.

Last updated