Sign Flutter App in Android Studio
- Launch Flutter app with Android Studio
- Click Tools > Flutter > Open for Editing in Android Studio
- Let it load the build tools
- Click Build > Generate Signed Bundle/APK
- Click Next to Generate Sign App Key
- Select Release and click Finish
- Keep key name and password handy
Create key.properties file in project android/ folder
storePassword=password
keyPassword=passowrd
keyAlias=keyName
storeFile=C:/Users/XXXX/storeKeyFileName.jks
Update build.gradle
[project]/android/app/build.gradle
Make no changes
def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}
signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
storePassword keystoreProperties['storePassword']
}
}
buildTypes {
release {
signingConfig signingConfigs.release
}
}
}
Generate Flutter Release Bundle
Once you have signed flutter app, reopen your flutter with Android Studio and build the app bundle
- Click Build > Flutter > Build App Bundle
Contents
show