Create jks with normal generate build flow like android and use it as a .jks
or type this common in your terminal
keytool -genkey -v -keystore ~/upload-keystore.jks -keyalg RSA -keysize 2048 -validity 10000 -alias aliasname -storetype JKS
For instance:
keytool -genkey -v -keystore /Users/mac/Desktop/Playstore_Live/appname.jks -keyalg RSA -keysize 2048 -validity 10000 -alias uploadAlias -storetype JKS
fill all Detail it will ask for
Reference the keystore from the app
Create a file named [project]/android/key.properties that contains a reference to your keystore:
Copy and paste in key.properties
storePassword=<password from previous step>
keyPassword=<password from previous step>
keyAlias=<Alias name from previous step> // uploadAlias
storeFile=<location of the key store file, such as /Users/<user name>/upload-keystore.jks>
Warning: Keep the key.properties file private; don’t check it into public source control.
Configure signing in gradle
COPY AND PASTE IN [project]/android/app/build.gradle file before the android block.
def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}
android {
...
}
And replace it with the following signing configuration info:content_copy
signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
storePassword keystoreProperties['storePassword']
}
}
buildTypes {
release {
signingConfig signingConfigs.release
}
}
Create Build
- flutter build apk --no-shrink
- flutter build apk --release
- flutter build appbundle