Deploying a Flutter app to the Google Play Store involves several steps to prepare your application for release. This guide provides an overview of the necessary steps to deploy your Flutter app on Android.
Update pubspec.yaml
: Ensure all dependencies are up-to-date and correctly configured.
Set Up App Icon and Splash Screen:
Configure App Permissions:
AndroidManifest.xml
based on your app’s requirements.Generate a Keystore:
A keystore is required to sign your APK. Generate one using the following command:
keytool -genkey -v -keystore <your_keystore_name>.keystore -keyalg RSA -keysize 2048 -validity 10000 -alias <your_key_alias>
Follow the prompts to provide details for the keystore.
Configure Gradle:
Update the android/gradle.properties
file to include your keystore details:
# Add these lines to gradle.properties
android.useAndroidX=true
android.enableJetifier=true
Update the android/app/build.gradle
file to include signing configuration:
android {
...
signingConfigs {
release {
keyAlias '<your_key_alias>'
keyPassword '<your_key_password>'
storeFile file('<path_to_your_keystore>.keystore')
storePassword '<your_keystore_password>'
}
}
buildTypes {
release {
signingConfig signingConfigs.release
// Other configurations for release
}
}
}
Build the APK:
Run the following command to build the release APK:
flutter build apk --release
The APK will be generated in the build/app/outputs/flutter-apk/
directory.
Build the App Bundle:
App Bundles are the recommended format for publishing on Google Play. Build the AAB using the following command:
flutter build appbundle --release
The AAB will be generated in the build/app/outputs/bundle/release/
directory.
Create a Developer Account:
Create a New Application:
Upload the APK or AAB:
Fill in App Details:
Set Pricing and Distribution:
Submit for Review:
For more detailed information, refer to the Flutter Android deployment documentation and Google Play Console Help.