10

I registered for the Google Play app signing capabilities and am having an issue trying to generate the upload key.

I followed the section under: Generate a key and keystore in this article, https://developer.android.com/studio/publish/app-signing. I was able to generate the .jks file.

After this step, things get really confusing as I was unable to find doc. that explains how to generate and use the upload key. I ended up finding this article that provides a keytool command to generate the upload key, How do I make a signed apk with upload key?.

The issue occurs when I try to run that command I keep getting this error message: java.lang.Exception: Alias does not exist. The weird thing is that the .pem file seems to get generated even though I am getting this error.

How can I fix this issue to avoid getting this error? Is this a valid .pem file since I keep getting this error?

user1790300
  • 2,143
  • 10
  • 54
  • 123

3 Answers3

21

Replace "upload" with your correct alias such as key0. e.g

keytool -export -rfc -alias key0 -file upload_certificate.pem -keystore keystore.jks
Mitch M
  • 378
  • 5
  • 6
  • For people coming to this from a Keystore created by Unity, the "name" to put in there is what you called it at the top of the popup window ie: "release" – akaBase Dec 17 '19 at 15:20
  • It is giving me this error: **The private key was not properly encrypted, or is not a type of key we support** – Pawan Jun 09 '23 at 11:56
1
1、keytool -importkeystore -srckeystore {keyname.keystore} -srcstoretype JKS -deststoretype PKCS12 -destkeystore {p12name.p12}

2、keytool -v -importkeystore -srckeystore {p12name.p12} -srcstoretype PKCS12 -destkeystore {jksname.jks} -deststoretype JKS

3、keytool -export -rfc -keystore {jksname.jks} -alias {key alias} -file upload_certificate.pem

tip:  {} Replace with the name you need。
0

I had the same issue, but in my case it was just a silly mistake of copy paste. I created key with different alias name and in terminal command I was passing different alias name.

So if you are copying command provided by support team in email, you should use your alias name, not "upload".

Hope this will solve your issue.

Hardik Maru
  • 661
  • 5
  • 8