Your Android App Bundle is signed with the wrong key. Ensure that your app bundle is signed with the correct signing key and try again

85,348

Solution 1

I tried using the multiple answers here & in this question, but somehow I was getting this error because I had some issues with my android/app/build.gradle and android/gradle.properties files.

Two things you should check (in addition to the other solutions here) are:

  1. In android/gradle.properties and android/app/build.gradle, make sure your keystore variables match exactly.
    • In android/gradle.properties, you probably have something like this:
      MYAPP_RELEASE_STORE_FILE=<>
      MYAPP_RELEASE_KEY_ALIAS=<>
      MYAPP_RELEASE_STORE_PASSWORD=<>
      MYAPP_RELEASE_KEY_PASSWORD=<>
      
    • Make sure these variable names exactly match those in android/app/build.gradle:
      android {
          ...
          signingConfigs {
              release {
                  if (project.hasProperty('MYAPP_RELEASE_STORE_FILE')) {
                      storeFile file(MYAPP_RELEASE_STORE_FILE)
                      storePassword MYAPP_RELEASE_STORE_PASSWORD
                      keyAlias MYAPP_RELEASE_KEY_ALIAS
                      keyPassword MYAPP_RELEASE_KEY_PASSWORD
                  }
              }
          }
      }
      
  2. In android/app/build.gradle, make sure you set signingConfig to signingConfigs.release in your release buildTypes:
    android {
        ...
        buildTypes {
            debug ...
            release {
                signingConfig signingConfigs.release
            }
        }
    }
    

Solution 2

The error suggests that you have uploaded an APK or an App Bundle previously. All the artifacts you upload to the Play Console should all be signed with the same keystore. So the error means that you signed the App Bundle with a key that is different than the ones you have uploaded previously. You have to either find that keystore you used before or reset the key by contacting Play Console support team.

Solution 3

I was banging my head on the table over this for about two hours. When I finally gave up and was filling out my "reset key" request, I realized that I was currently attempting to upload it to the wrong project the whole time.

So, step one: confirm that you're attempting to upload to the correct project.

Solution 4

Just rebuild the project and generate signed apk once again and try !

Wasted my 2 days on this, had my keystore key but still showed error and request google for generating new key.... Read some random stackoverflow, where it was written to rebuild the project and try uploading once again.. IT WORKED !

Solution 5

Read this is you have requested a new upload key from Google Play and still get this error (should work for both native Android and Flutter as well).

I had experienced the same problem. And here's out steps on how to resolve it:

  1. We've lost the upload key (initial keystore file, probably .jks) that was used to sign the app.
  2. We created a new keystore file and exported created certificate to PEM format as stated here in the docs. We sent the request to the Google Play Team to reset our key, attached .pem file.
  3. When Google Play team reset the key we've tried to use the new .jks keystore we had created in the step 2 and the error appears one more time.

The solution is to clean your project, rebuild it from scratch to reset all the cached builds.

In case of Flutter (we had this error building the app using Flutter). Make sure you use

flutter clean

Build the application on simulator or device.

Then run:

flutter build appbundle --release

This is how it was solved in our case.

PS. This should also help on native Android too.

Share:
85,348
Admin
Author by

Admin

Updated on July 05, 2022

Comments

  • Admin
    Admin about 2 years

    How do I sign my android app bundle with the correct signing key?