How to Upload Publish Flutter App To google play store

Hello friends, today we will learn step by step how to generate APK or ABB file in flutter applications

Without prior knowledge of these aspects, the process can be time consuming.

By the end of this tutorials, you'll have a clear understanding of how to:

  1. Generate a keystore jks file :
  2. Create key.pro file :
  3. Eedit build.gradle
  4. Generating apk file
  5. Generating abb file

Step1. Generate a keystore jks file :

Command For Windows OS :

C:\"Program Files"\Android\"Android Studio"\jbr\bin\keytool -genkey -v -keystore kinjkalp.jks -keyalg RSA -keysize 2048 -validity 10000 -alias kinjkalp

Command For Mac OS :

/Applications/Android\ Studio.app/Contents/jbr/Contents/Home/bin/keytool -genkey -v -keystore kinjkalp.jks -keyalg RSA -keysize 2048 -validity 10000 -alias kinjkalp

This command stores the kinjkalp.jks file in your root directory. and this file copy and pest for android/app this locations

Step2. Create key.pro file :


GO to android filder and mac a new file for name key.pro and cooy for belov code

storePassword=********* //password-from-previous-step

keyPassword=********* //password-from-previous-step

keyAlias=kinjkalp

storeFile=<kinjkalp.jks

Step3. Eedit build.gradle

Goto [project]/android/app/build.gradle 

def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
    keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}

android {
   .......
   .......
}
android {
    // ...

    signingConfigs {
        release {
            keyAlias = keystoreProperties['keyAlias']
            keyPassword = keystoreProperties['keyPassword']
            storeFile = keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
            storePassword = keystoreProperties['storePassword']
        }
    }
    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
            signingConfig = signingConfigs.release
        }
    }
........
........
}


Step4. Generating apk file

flutter build apk

Step5. Generating abb file

flutter build appbundle

Thanks, guys, that's all for now, make sure to clap and leave some engagement. If there are any improvements or feedback, feel free to comment.

If any of my bad posts help you in any way, you might want to consider buying me a cup of coffee.