Fix Android App Bundle Signing Key Error (Step-by-Step Guide)

πŸš€ How to Fix “Android App Bundle is Signed with the Wrong Key” Error

If you are uploading your Android App Bundle (.AAB) to Google Play Console and you see this error:

"Your App Bundle is signed with the wrong key. Ensure that your App Bundle is signed with the correct signing key..."

Don’t worry — this guide will show you exactly how to fix it step-by-step.


πŸ”΄ What Causes This Error?

This error happens when:

  • You are using a different keystore (.jks) than the one registered in Play Console
  • Android Studio auto-generates a debug or new release key
  • You changed devices or rebuilt your project

✅ Step 1: Generate a Correct Upload Key (.jks)

Open your terminal or command prompt and run:

keytool -genkeypair -v -keystore upload-key.jks -alias upload -keyalg RSA -keysize 2048 -validity 10000

During setup, you will be asked:

  • Name (CN)
  • Organization (O)
  • Country code (C → use NG for Nigeria)

After completion, you will get:

upload-key.jks

πŸ” Step 2: Verify Your Keystore

Check your SHA1 fingerprint:

keytool -list -v -keystore upload-key.jks

Make sure it matches your Play Console expected SHA1.


⚙️ Step 3: Add Signing Config in Gradle

Inside app/build.gradle.kts, add:

signingConfigs {
    create("release") {
        storeFile = file("upload-key.jks")
        storePassword = "YOUR_PASSWORD"
        keyAlias = "upload"
        keyPassword = "YOUR_PASSWORD"
    }
}

πŸ“¦ Step 4: Connect Signing to Release Build

buildTypes {
    release {
        isMinifyEnabled = false

        signingConfig = signingConfigs.getByName("release")

        proguardFiles(
            getDefaultProguardFile("proguard-android-optimize.txt"),
            "proguard-rules.pro"
        )
    }
}

πŸš€ Step 5: Generate Signed App Bundle

Now build your release AAB:

Build → Generate Signed Bundle / APK → Android App Bundle

Or use Gradle:

./gradlew bundleRelease

πŸ“Œ Final Result

If everything is correct:

  • ✔ No SHA1 mismatch error
  • ✔ Successful upload to Play Console
  • ✔ App published or updated successfully

πŸ’‘ Conclusion

The key to solving this issue is ensuring your keystore (.jks) matches the one registered in Google Play Console. Once correctly configured in Gradle, your app will upload without errors.


Tags: Android, Google Play Console, AAB, Keystore, Android Studio, App Signing

Comments

Popular posts from this blog

From DSRC to 5G NR-V2X: The Road Ahead for Connected Vehicles