Skip to content

Instantly share code, notes, and snippets.

@ehabdevel
Created July 18, 2025 19:53
Show Gist options
  • Select an option

  • Save ehabdevel/ea4cdf10d7ae4f6366a1e1ca71720b1d to your computer and use it in GitHub Desktop.

Select an option

Save ehabdevel/ea4cdf10d7ae4f6366a1e1ca71720b1d to your computer and use it in GitHub Desktop.
How to generate a Google Play upload key and keystore for a Flutter app in Android Studio?
1- run this command:
keytool -genkeypair -v -keystore key.jks -keyalg RSA -keysize 2048 -validity 10000 -alias key
2-Create a file named key.properties in the android directory of your project
3-Add the following lines and replace the placeholders with the values from the keystore you generated:
storePassword=toio123
keyPassword=toio123
keyAlias=key
storeFile=../app/key.jks
4-Open android/app/build.gradle and add the signing config:
android {
...
signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile file(keystoreProperties['storeFile'])
storePassword keystoreProperties['storePassword']
}
}
buildTypes {
release {
signingConfig signingConfigs.release
...
}
}
...
}
5- android/app/build.gradle above android
def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}
android {
...
6- finally Run the following command:
flutter build appbundle --release
Thanks to ahmedRafat
https://stackoverflow.com/questions/70960040/how-to-generate-a-google-play-upload-key-and-keystore-for-a-flutter-app-in-andro
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment