Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 922
Ahsan Avatar asked Jun 14 '21 10:06

Ahsan


People also ask

How do you fix 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?

Answers related to “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” first, you need to generate a signing key using keytool and create keystore file for your project.

How do I change my app bundle signing key?

Open you React Native's project android folder. Go to Build -> Generate Signed Bundle / APK. Select Android App Bundle. 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.

Why is my Android app bundle signing key not working?

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 Ask Question Asked3 years, 3 months ago

How to sign APK/AaB file in Google Play Store?

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. In order for you to use your previous projects/apps keystore file for signing apk/aab file, you need to check the second option.

Why is my APK signing with a different keystore?

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.

How to generate signed bundle/APK from debug keystore?

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


Video Answer


2 Answers

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.

like image 113
Ahsan Avatar answered Oct 21 '22 13:10

Ahsan


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 :)

like image 2
Marek Bodziony Avatar answered Oct 21 '22 13:10

Marek Bodziony