Make signed application for playstore publish — Flutter Application

Kanai Shil
1 min readMay 16, 2022
  1. At the first step you have to generate a signer file(.jks) using keytool.
    keytool -genkey -v -keystore c:\Users\USER_NAME\upload-keystore.jks -storetype JKS -keyalg RSA -keysize 2048 -validity 10000 -alias upload

2. Create a file named [project]/android/key.properties that contains a reference to your keystore:
storePassword=<password from previous step>
keyPassword=<password from previous step>
keyAlias=upload
storeFile=<location of the key store file, such as /Users/<user name>/upload-keystore.jks>

3. Configure gradle to use your upload key when building your app in release mode by editing the [project]/android/app/build.gradle file.
def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}

android {
...
}

4. Find the buildTypes block:
buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now,
// so `flutter run --release` works.
signingConfig signingConfigs.debug
}
}

5. And replace it with the following signing configuration info:
signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
storePassword keystoreProperties['storePassword']
}
}
buildTypes {
release {
signingConfig signingConfigs.release
}
}

6. Now run
flutter build appbundle

7. Done! now you can upload your application on playstore/play-console.

--

--

Kanai Shil

Software Developer with over 6 years of experience in HTML CSS JS development projects, Having a piece in-depth knowledge of PHP,Database,Flutter,and MERN Stack