2

I lost my keystore (.jks) file, and I was lucky - I used App signing before. Therefore, Google was able to help me and reset my key.

But what is the next step with the SHA1 google gave me by mail? They gave me the instruction for generating an upload_certificate.pem file that I sent them by mail.

And then, Google's answer was:

Good news - I was able to register your new upload key, you would need to update your app to use the new upload key certificate: SHA1:....

Now I try to upload the APK with the jks file I used to generate the PEM file, also with a newly created jks file. in Google play console I get:

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

What is the next step?

Upsilon42
  • 241
  • 2
  • 17
  • When did you receive the email? It usually takes 2 days for the newly uploaded keystore to take effect. – jbmcle Feb 08 '19 at 02:45
  • @jake you are right, They told me it will take 2 days, it's been a week. I don't even know what to do now. – Upsilon42 Feb 08 '19 at 07:29
  • Are you sure you're using the same keystore and same alias as what you used to generate the certificate you sent them? If so, contact them again. – Pierre Feb 08 '19 at 08:00
  • Hi @Pierre :) yes I'm using the same. but what do you mean by using? i'm trying to update again with the keystore i generetad the pem file (for google) with. is that supposed to work? – Upsilon42 Feb 09 '19 at 10:56
  • Hi, @Pierre I remember you said somewhere that you implemented most of this, as a Google developer. please look at my own answer. Is it a bug, or something I missed? thanks mate! – Upsilon42 Feb 09 '19 at 14:56
  • 1
    Thanks for following up with the fix. This could be a bug in Studio. If you could file a bug in Studio's issue tracker, the team could investigate. – Pierre Feb 09 '19 at 21:47
  • @Upsilon42 Did you use Firebase in your project by any chance? Did you change the SHA1 there? – who-aditya-nawandar Feb 27 '22 at 07:37

2 Answers2

2

Presumably you created a new upload key following the instructions under "Create an upload key". These are roughly:

  • generate an upload key and store it safely. This gives you a key with alias something like "upload" in a keystore called something like "upload-keystore.jks"
  • export your certificate in PEM format using a command like $ keytool -export -rfc -keystore upload-keystore.jks -alias upload -file upload_certificate.pem

If this is what you did, then you need to sign your app with the keystore you created in step 1 "upload-keystore.jks" using alias "upload"

The SHA1 they sent you is just a way of confirming you used the right keystore. If you are still using the keystore for the PEM you sent them, then if you print out the certificate keystore from your APK it should match that SHA1.

You can print the SHA1 of the certificate from your signed APK with the command

keytool -list -printcert -jarfile app.apk

This will tell you the SHA1 of the certificate (key/keystore) you have used to sign it.

Nick Fortescue
  • 13,530
  • 1
  • 31
  • 37
  • 1
    ok, so I guess I did what I was supposed to, generatean apk with the jks i used for the pem. it doesnt work. I guessI will have to contact them again. – Upsilon42 Feb 08 '19 at 10:35
0

After I tried everything that came in mind, including "Invalidate cache and restart" in Android studio, the solution that worked was Build->clean. Thanks to Dave Hubbard's answer

Upsilon42
  • 241
  • 2
  • 17
  • I tried that myself. Was hoping that it work, but it didn't. I'm hoping that it was an error on Google's end and not A.S. – Brian M Jul 12 '22 at 00:55