Generate Release Version
Android Release Configuration
Before generating a release version of your Android app, you need to ensure the correct signing configuration is set up in your build.gradle file.
Generate Keystore File
If you haven't already generated a keystore file, follow these steps:
-
Open terminal
-
Navigate to your project's
android/appdirectory -
Run the following command:
For Mac/Linux:
keytool -genkey -v -keystore YOUR-KEYSTORE-FILE.jks -keyalg RSA -keysize 2048 -validity 10000 -alias YOUR-ALIASFor Windows:
keytool -genkey -v -keystore YOUR-KEYSTORE-FILE.jks -storetype JKS -keyalg RSA -keysize 2048 -validity 10000 -alias YOUR-ALIAS -
Follow the prompts to set up your keystore.
Update Signing Configuration
- Open
android/app/build.gradle - Locate the
signingConfigsblock - Make sure the release configuration is set to
releaseinstead ofdebug
buildTypes {
release {
signingConfig signingConfigs.release
minifyEnabled false
shrinkResources false
}
}
}
- Update the contents at
android/key.propertieswith your keystore details.
Example Values
storePassword=123456 //Replace with password you set when generating keystore
keyPassword=123456 //Replace with password you set when generating keystore
keyAlias=upload //Replace with alias you set when generating keystore
storeFile=keystore.jks //Replace with keystore file name
note
This will be the same value which you provided when generating the keystore (.jks file)

note
The keystore file should be placed in the android/app directory
danger
- Never commit your keystore file or passwords to version control
- Store your keystore file securely
- Keep a backup of your keystore file - if you lose it, you won't be able to update your app on the Play Store
Generating Release APK
- Open terminal in your project root directory
- Run the following command:
flutter build apk --release - The release APK will be generated at:
build/app/outputs/flutter-apk/app-release.apk
iOS Release Configuration
For iOS release builds:
- Open Xcode
- Select your target
- Go to Signing & Capabilities
- Ensure you have:
- Valid provisioning profile
- Valid distribution certificate
- Correct team selected
- Correct bundle identifier
Generating iOS Release
- Open terminal in your project root directory
- Run the following command:
flutter build ios --release - Open the generated Xcode project:
open ios/Runner.xcworkspace - In Xcode:
- Select "Any iOS Device" as the build target
- Go to Product > Archive
- Follow the steps to upload to App Store Connect
Troubleshooting
Common issues and solutions:
-
Android signing issues:
- Verify keystore file exists in correct location
- Check keystore passwords are correct
- Ensure signingConfig is set to
release
-
iOS signing issues:
- Verify certificates are valid in Apple Developer account
- Check provisioning profiles are up to date
- Ensure bundle identifier matches your app's configuration