How to Fix Build Errors Saying “Signature Key Mismatch” (Flutter/MacOS)
Error Message:
Your Android App Bundle is signed with the wrong key.
Please sign your App Bundle with the correct signing key and try again.
The App Bundle must be signed with the certificate that has the fingerprint:
SHA1: 40:55:7C:… (example)“
However, the certificate used to sign the uploaded App Bundle has the fingerprint:
SHA1: F9:C9:6A:…(example)”
The cause is that the “app signing key” previously registered in the Google Play Console differs from the key used in this build.
Troubleshoot and fix in the following order:
First, verify which key signed the built .aab file.
keytool -printcert -jarfile build/app/outputs/bundle/release/app-release.aab | grep -i SHA1
For Windows (PowerShell)
keytool -printcert -jarfile build\app\outputs\bundle\release\app-release.aab | Select-String SHA1
→ The fingerprint shown in the error (e.g., F9:C9:6A:…) should appear here.
This is the signing key you are currently using.
Google Play Console requires the fingerprint 40:55:7C:…(example).
If you don’t know which keystore you used, perform the following search:
find ~ -name “*.jks”
find ~ -name “*.keystore”
For Windows (PowerShell)
Get-ChildItem -Path $HOME -Recurse -Include *.jks,*.keystore
You may find files like these:
/Users/you/.android/debug.keystore
/Users/you/AndroidStudioProjects/.../my-release-key.keystore
/Users/you/AndroidStudioProjects/keystores/upload-keystore.jks
Execute the following for each found keystore:
Command example (for alias: key0)
keytool -list -v -keystore /path/to/keystore.jks -alias key0
For Windows
keytool -list -v -keystore C:\path\to\keystore.jks -alias key0
If the alias is unknown, try common names sequentially:
key0uploadreleasemy-key-aliasandroiddebugkey (for debug.keystore)🔑 What is an alias?
- A keystore (.jks file) contains “keys”.
- An alias is the name assigned to distinguish these keys.
- While a keystore can hold multiple keys, it typically contains and uses only one key.
After entering the password, the SHA-1 hash will be displayed. Verify that it matches the format required by the Play Console: “SHA1: 40:55:7C:… (example)”.
🔑 Password (storePassword)
- This is the password you set when creating the keystore (.jks file).
- If you don’t know the password and can’t open the keystore, proceed to 4. Reset Upload Key, similar to when the signing key cannot be found.
If you have identified a keystore/alias matching the SHA1 required by the Play Console, verify the signingConfig settings in android/app/build.gradle.
signingConfigs {
release {
storeFile file(keystoreProperties[‘storeFile’])
storePassword keystoreProperties[‘storePassword’]
keyAlias keystoreProperties[‘keyAlias’]
keyPassword keystoreProperties[‘keyPassword’]
}
}
android/key.properties (create it if it doesn’t exist).storeFile=/Users/you/AndroidStudioProjects/keystores/upload-keystore.jks
storePassword=*****
keyAlias=upload
keyPassword=*****
Rebuild → Verify the signature’s SHA-1 from the .aab file
flutter clean
flutter pub get
flutter build appbundle --release
keytool -printcert -jarfile build/app/outputs/bundle/release/app-release.aab | grep -i SHA1
→ Verify it matches the SHA1 requested by Play Console before uploading
If you cannot find the correct key, and Play App Signing is enabled (enabled by default),
Google holds the production key used for distribution, and you can only reset the “upload key”.
keytool -genkeypair \
-alias upload \
-keyalg RSA \
-keysize 2048 \
-validity 10000 \
-keystore upload-keystore.jks
Example:
/Users/you/AndroidStudioProjects/keystores/upload-keystore.jks
keytool -export -rfc \
-keystore upload-keystore.jks \
-alias upload \
-file upload_certificate.pem
Modify android/key.properties to match the new key:
storeFile=/Users/you/AndroidStudioProjects/keystores/upload-keystore.jks
storePassword=*****
keyAlias=upload
keyPassword=*****
flutter clean
flutter pub get
flutter build appbundle --release
Verify the generated .aab has the new SHA-1:
keytool -printcert -jarfile build/app/outputs/bundle/release/app-release.aab | grep -i SHA1
→ If it matches the SHA-1 registered as the “Upload Key” in Google Play Console, it’s OK.