2025年6月11日星期三

Flutter Android App Signing

 1- Generate and get .jks from android studio.

2- Create a key.properties under android file as following format.

storePassword=
keyPassword=
keyAlias=
storeFile= //file path of jks

3- Go to your app level build gradle and get key.properties with following code.

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

4- Add signing configurations inside the android tag.

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

5- Make sure about your signingConfig is release as following ;

buildTypes {
release {
signingConfig signingConfigs.release
}
}

6- Run ‘flutter build appbundle’ command .

沒有留言:

發佈留言