Keystore file exists but is empty?

The Prophet picture The Prophet · Jul 26, 2016 · Viewed 11.5k times · Source

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.

Answer

Grzegorz Bielański picture Grzegorz Bielański · Apr 9, 2017

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