Flutter | Pre-requisite for publishing app

Mohammed Waseem
2 min readApr 17, 2023

--

Flutter android app

First App name and Icon

Android

In your CMD run (Windows):

keytool -genkey -v -keystore C:\Users\%userprofile%>\upload-keystore.jks -keyalg RSA -keysize 2048 -validity 10000 -alias upload

Remember what you typed here: 👆.

Then, move the file into android > app > upload-keystore.jks

Then create a new file in andoid > key.properties

and enter in it the below code.👇

NOTE: If your app requires the internet, include the below line in

android > app > src > main > AndroidMnifest.xml

Continuing ,

in android > app > build.gradle add the following code

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

Where should I add? ( Above android {….} )

And change signingConfigs.debug to signingConfigs.release

Next, add the following as shown in the below image (Above build types)

signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
storePassword keystoreProperties['storePassword']
}
}

Next in the project terminal, run these 2 commands:

  1. flutter clean
  2. flutter pub get

Finally, run the below command to build the app file:

> flutter build appbundle

Now you can publish at Google Play Console

--

--