'Error: "Your Android App Bundle is signed with the wrong key." How to sign apk/aab using Google provided signing information

While uploading my second app project to PlayStore, I got the following error while upload .aab file for a new release:

enter image description here

"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. Your App Bundle is expected to be signed with the certificate with fingerprint: ::::: "

What I did was use my first apps singing key/ my old keystore file and used this keystore file inside Android studio "build-> Generate signed bundle/apk" to generate my aab file.

Inside PlayConsole, I have checked "Let Google manage and protect your app signing key" so I think, now Google is also keeping this keystore file safe.

When inside Google PlayConsole, I visit "Release > Setup > App integrity", I can see that there is an upload certificate and SH1 certificates but this information is different from previous apps keystore.

What I don't understand is why fingerprint of the previous app and it's alias is different from the current one?

I can download this Google managed certificate file from PlayConsole but I cannot use this certificate file to use as a "keystore" to sign my apk/aab file.

I have been reading answers on different forums but none of the solutions worked for me.



Solution 1:[1]

Finally after two days of trying different options, I was finally able to solve the problem.

What I did was delete my project from PlayConsole and tried to start things over once again.

What I found out is

"Let Google manage and protect your app signing key"

was not the correct option to consider for me, if I want to use my old keystore file.

enter image description here

When setting your app for the first time in the PlayConsole, when you click on

"Manage app signing"

you are presented with following options:

1. Let Google manage and protect your app signing key (recommended)
2. Use the same key as another app in this developer account.
3. Export and upload a key from Java keystore.

enter image description here

In order for you to use your previous projects/apps keystore file for signing apk/aab file, you need to check the second option.

Once, I checked this option, I was finally able to upload my app to playstore succesfully.

Solution 2:[2]

I had the same problem. But in my case I've lost my keys when I've changed my computer. And I wasn't able to publish new app in Play store, while still getting this signing error.

This is what helps me:

  1. I've generated new upload key and keystore in Android Studio, using this procedure - link
  2. in Google Play Console I've started new upload of app
  3. when choosing "Manage App Signing" I've selected option 3 (Export and upload a key from Java keystore)
  4. I've done all the steps described there:
    • download PEPK
    • in folder where I've dowloaded PEPK I've run java command with credentials (key store path and key alias) from newly generated keys in Android Studio
    • script asked me for password for newly generated key store and key
    • I've uploaded generated by script zip file
  5. I've uploaded new app to Play store, no more error with wrong signing

I hope it helps someone, it tooks me 3 days to find this solution :)

Solution 3:[3]

your need to change code

signingConfig signingConfigs.debug

to

signingConfig signingConfigs.release

Solution 4:[4]

I've created a new application, too.

However, haven't changed anything related how to manage the app signing. Instead, I've cleared the credentials by running expo build:android --clear-credentials and then selected the option Generate new keystore when Expo CLI has asked ? Would you like to upload a Keystore or have us generate one for you? If you don't know what this means, let us generate it! :).

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Ahsan
Solution 2 Marek Bodziony
Solution 3 Arif Maksum
Solution 4 Daniel Danielecki