Keystore file exists but is empty?
Asked Answered
C

3

6

I need the SHA 1 fingerprint from my RELEASE key and as I understand the key is generated when I select the option in Android Studio to build a signed release APK and then I get a Keystore.jks file.By following the google documentation I did this command keytool -exportcert -list -v \ -alias <your-key-name> -keystore <path-to-production-keystore>, but this gave me illegal options:/ error so I looked around the net and did this keytool -exportcert -alias freenthrowkey -keystore C:\Users\User\Documents\FreeNthrowkey

and this now gives me this error: keytool error: java.lang.Exception: Keystore file exists, but is empty: C:\Users\User\Documents\FreeNthrowkey

Please if anyone could help me out I would REALLY appreciate it.

Corrasion answered 26/7, 2016 at 13:31 Comment(2)
this might be helpful to you: https://mcmap.net/q/63864/-how-to-check-certificate-name-and-alias-in-keystore-filesCherida
I downloaded the program and it showed me the key and the fingerprint :D, but my google sign in still isnt working , but atleast it solved me this problem. If you post it as an answer I will accept it.Corrasion
C
3

Using following commands should give you proper output:

keytool -list -keystore .keystore

If you are looking for a specific alias, you can also specify it in the command:

keytool -list -keystore .keystore -alias foo

Also, to generate signed APK I suggest you to use Android studio itself. Choose "Generate Signed APK" from Build menu of Android studio and follow the steps. It will generate proper keystore at given path.

enter image description here

Cherida answered 26/7, 2016 at 15:48 Comment(0)
I
13

I had exectly the same problem. Issue appear when you give path to keystore file without the file name. You have to give keystore file name with the path after -keystore option. This means in your case:

keytool -exportcert -alias freenthrowkey -keystore C:\Users\User\Documents\FreeNthrowkey\KEYSTOREFILENAME.jks

Ianthe answered 9/4, 2017 at 5:47 Comment(1)
This solved it! The problem was the missing keystore file name!Ariannearianrhod
C
3

Using following commands should give you proper output:

keytool -list -keystore .keystore

If you are looking for a specific alias, you can also specify it in the command:

keytool -list -keystore .keystore -alias foo

Also, to generate signed APK I suggest you to use Android studio itself. Choose "Generate Signed APK" from Build menu of Android studio and follow the steps. It will generate proper keystore at given path.

enter image description here

Cherida answered 26/7, 2016 at 15:48 Comment(0)
P
0

If you are using windows check the following path %USERPROFILE%.android\debug.keystore

It might be already generated previously

Pippas answered 6/10, 2020 at 16:30 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.