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

AndroidGoogle Play

Android Problem Overview


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

Android Solutions


Solution 1 - Android

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 2 - Android

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 3 - Android

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 - Android

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 - Android

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.

Solution 6 - Android

Well after wasting hours on this problem ,Below Solution works for me -

When you are creating signed bundle it gets saved to some location, Then when it gets rejected, you went again to make new Signed Bundle, Well thats where the mistake happens.

See when now you will create another signed bundle, you sign it another folder , assuming that previous one was made last time, , make sure you store the signed key in the "SAME FOLDER", No need to make any new signed key path , JUST use the path you used while doing it for First time.

See this image, use the same path which you have used during first time

Use the same JKS FILES as you have used for the first time. NOW WHEN YOU WILL MAKE BUNDLES FILE, IT WILL BE HAVING THE CORRECT KEY.

Thank You!!!

Solution 7 - Android

React Native here!

I got this error after trying to upload the generated .aab file from the ./gradlew bundleRelease command. I fixed it by exporting the .aab file by using Android Studio again. I believe that this is the way to upload your first .aab file to Google Play anyway. In case you don't know how:

In Android Studio:

  1. Open you React Native's project android folder
  2. Go to Build -> Generate Signed Bundle / APK
  3. Select Android App Bundle
  4. Enter your key-store details (if this is your first time doing this, you have to check the Export encrypted key checkbox, which you can use for Google Play App signing) and click Next
  5. When Android Studio finishes it gives you the option to locate the file(s) created

Now if you upload this .aab file, it should be accepted.

Solution 8 - Android

Late answer(for any one possibly still struggling with this topic)-

You may have forgot the .jks file of that project.

  1. Search for .jks files in File explorer.

  2. Connect it to your project.

Solution 9 - Android

I realized that when I upload apk it gives more detailed error. so maybe try that solve errors and maybe then try app bundle.

hope it helps.

Solution 10 - Android

For those who have released apk without a manually generated keystore and facing this issue when trying to release the apk or bundle from a different machine, follow the below steps:

> 1. Copy debug.keystore (C:\Users\username\.android\debug.keystore) from the machine which used to build the first version of the App > > 2. Select Build > Generate Signed Bundle/APK > > 3. Provide the Key store path to the debug.keystore file > > 4. Fill the other fields with the default values mentioned below and build

Keystore name: "debug.keystore"
Keystore password: "android"
Key alias: "androiddebugkey"
Key password: "android"
CN: "CN=Android Debug,O=Android,C=US"

Solution 11 - Android

Make sure you are using the correct JKS for App Signing.

Common developer error, Android app with multiple flavours sign bundle using different JKS file.

Solution 12 - Android

In google play console I solved this issue by going to the aab archive tab and removed all existing versions there. Then I went back to production and choose change key for app signing. After this I could successfully upload my aab file.

Solution 13 - Android

I got the same error :

In my case, I was trying to upload debug version. That caused me this error.

So I changed below line in app-level Gradle:

signingConfig signingConfigs.debug

With:

signingConfig signingConfigs.release

Solution 14 - Android

there is **sign in key ** just click and upload with new keystore file that created manually

enter image description here

Solution 15 - Android

What I did was exclude my android files from git, then when I changed branch and rebuilt, my build.gradle file was overwritten.

Solution 16 - Android

I am using expo to build my app bundle. In my case, I had to:

  1. Manually create a new keystore file.
    Or download your existing keystore using command expo fetch:android:keystore

  2. Download the Upload certificate of my app from Google Play Console

  3. Import the Upload certificate of the app into the newly created keystore file, giving it a key alias and a password. This is easily done using the java keytool. In MacOS is in the path so issue a keytool -h to see the various commands available.

  4. run expo ba -c , took the manual route and when asked, I specified the keystore file I created in step 1.

Solution 17 - Android

I had the same error when building a signed Android App Bundle.
For debug purposes on the local maschine, I enabled debuggable in the release build type.
It seems, Playstore recognized an debug build and simply said it is not a valid Bundle.

build.gradle:

buildTypes {
     release {
         minifyEnabled true
         proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
         //debuggable = true  <----- Works like expected when disabled
     }
}

Solution 18 - Android

Verify the details as shown in image and body

This is worked for me!


> While uploading apk/bundle first time to play store you might generated private_key.pepk then your key might be also changed. So if you selected default key alias key0 then make sure you selected proper alias then only proceed. If that steps is correct then your bundle will be upload successfully.


Solution 19 - Android

I got the same error : enter image description here

In my case I changed :

android {
compileSdkVersion 30

with

android {
compileSdkVersion 31

and

targetSdkVersion 30

with

targetSdkVersion 31

and it worked. Hope it will work for you.

Solution 20 - Android

if you lost your upload-keystore.jks file then either you have to reset the upload signing key or create a new app with new app bundle. for reset the upload the key-store.jks follow the link below.He has explained very nicely how to do that. reset the signing key

Solution 21 - Android

I already provided the answer here which can be you mistake as well please check it here. https://stackoverflow.com/a/72136948/14155787

Solution 22 - Android

Wowwww it it took me so long to understand why it is not working....

I changed the app key and send it to google and thy sent me to do: " Follow the instructions in the Android Studio Help Center to generate a new key. It must be different from any previous keys. Alternatively, you can use the following command line to generate a new key: keytool -genkeypair -alias upload -keyalg RSA -keysize 2048 -validity 9125 -keystore keystore.jks

This key must be a 2048 bit RSA key and have 25-year validity. Export the certificate for that key to PEM format: keytool -export -rfc -alias upload -file upload_certificate.pem -keystore keystore.jks

Reply to this email and attach the upload_certificate.pem file. "

i did it and the 1 thing that miss is to change in my keyAlias in the build.gradle to upload 臘‍♂️

Solution 23 - Android

If you are publishing app to playstore and find error 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: Then, If you have not generated/changed app bundle or rebuild/clean project before reaching the current state displayed in pic then make sure to make new app project on play console as play console might be mixing the two keys. image

Solution 24 - Android

It Worked for me with this solution I rebuild the project in Android Studio then i changed the version code, and export the project with new keystore in my console i deleted the release and create a new release and it worked good

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionskfpView Question on Stackoverflow
Solution 1 - AndroidPierreView Answer on Stackoverflow
Solution 2 - AndroidBlundering PhilosopherView Answer on Stackoverflow
Solution 3 - AndroidDavidView Answer on Stackoverflow
Solution 4 - AndroidShijen NView Answer on Stackoverflow
Solution 5 - AndroidatereshkovView Answer on Stackoverflow
Solution 6 - AndroidShridhar ChoukseyView Answer on Stackoverflow
Solution 7 - AndroidVasileios LitsasView Answer on Stackoverflow
Solution 8 - AndroidNilesh DeshmukhView Answer on Stackoverflow
Solution 9 - AndroidMammadView Answer on Stackoverflow
Solution 10 - AndroidMohammed JavadView Answer on Stackoverflow
Solution 11 - AndroidBharat LalwaniView Answer on Stackoverflow
Solution 12 - AndroidOperatorView Answer on Stackoverflow
Solution 13 - AndroidForhan ChowdhuryView Answer on Stackoverflow
Solution 14 - AndroidSyed HasanView Answer on Stackoverflow
Solution 15 - AndroidatreeonView Answer on Stackoverflow
Solution 16 - Androidchrisl08View Answer on Stackoverflow
Solution 17 - AndroidSunchezzView Answer on Stackoverflow
Solution 18 - AndroidRahul KambleView Answer on Stackoverflow
Solution 19 - AndroidMANISHView Answer on Stackoverflow
Solution 20 - AndroidDivyanshu BishtView Answer on Stackoverflow
Solution 21 - AndroidShoaib KhanView Answer on Stackoverflow
Solution 22 - AndroidEran SimtobView Answer on Stackoverflow
Solution 23 - AndroidRithik ChandnaniView Answer on Stackoverflow
Solution 24 - AndroidAyoubcoderView Answer on Stackoverflow