- After you make all your changes and customizations save all your project, Open the console, navigate to your project folder and execute the following command to build your app
flutter build apk --release
If you are deploying the app to the Play Store, it’s recommended to use app bundles or split the APK to reduce the APK size. To generate an app bundle, run:
flutter build appbundle --target-platform android-arm,android-arm64,android-x64
Learn more onΒ https://developer.android.com/guide/app-bundleΒ To split the APKs per ABI, run:
flutter build apk --target-platform android-arm,android-arm64,android-x64 --split-per-abi
Learn more onΒ https://developer.android.com/studio/build/configure-apk-splits#configure-abi-split
You should get the APK file in the build/output/apk folder, to install your application on your connected device run the following command
flutter install
If you want to upload your application on Google Play you must sign it before uploading, generate a signing key by running the following command:
keytool -genkey -v -keystore android/app/key.jks -keyalg RSA -keysize 2048 -validity 10000 -alias key
Open /android/app/build.gradle and edit the following attributes after that re-build your application:
signingConfigs {
release {
storeFile file(“key.jks”)
storePassword “password”
keyAlias “key name”
keyPassword “key password”
}
}