How to Deploy Flutter Apps to Google Play Store
flutter build appbundle. Then, upload the generated file to the Google Play Console, fill in the app details, and submit it for review.Syntax
Use the Flutter command to build a release version of your app as an Android App Bundle (.aab) or APK (.apk). The common commands are:
flutter build appbundle- builds an Android App Bundle for Play Store upload.flutter build apk --release- builds a release APK.
Before building, you must configure signing in android/app/build.gradle and create a keystore.
flutter build appbundle flutter build apk --release
Example
This example shows how to build a signed app bundle ready for Play Store upload.
1. Generate a keystore:
keytool -genkey -v -keystore ~/my-release-key.jks -alias my_key_alias -keyalg RSA -keysize 2048 -validity 10000
2. Reference the keystore in android/key.properties:
storePassword=your_store_password keyPassword=your_key_password keyAlias=my_key_alias storeFile=../my-release-key.jks
3. Configure signing in android/app/build.gradle under signingConfigs.
4. Build the app bundle:
flutter build appbundle
Common Pitfalls
1. Missing signing configuration: Without a proper keystore and signing setup, the Play Store will reject your app.
2. Uploading debug builds: Always build a release version; debug builds are not accepted.
3. Versioning errors: Make sure to update versionCode and versionName in android/app/build.gradle for each release.
4. Not enabling Play App Signing: It is recommended to enable Play App Signing for better security and easier updates.
/* Wrong: building debug APK */ flutter build apk /* Right: building release APK */ flutter build apk --release
Quick Reference
- Create a keystore with
keytool. - Configure signing in
android/app/build.gradle. - Build release app bundle with
flutter build appbundle. - Upload the .aab file to Google Play Console.
- Fill app details, screenshots, and submit for review.
Key Takeaways
flutter build appbundle before uploading.