2

This is what I need it for enter image description here

But I am getting this error:

keytool error: java.lang.Exception: Keystore file does not exist: path-to-debug-or-production-keystore java.lang.Exception: Keystore file does not exist: path-to-debug-or-production-keystore at sun.security.tools.keytool.Main.doCommands(Main.java:742) at sun.security.tools.keytool.Main.run(Main.java:340) at sun.security.tools.keytool.Main.main(Main.java:333)

This is the place where my keytool is c:\Program Files\Java\jdk1.8.0_65\bin> , so I'm pretty sure I'm in the right directory when applying the command to terminal.

EDIT: I used this command in terminal :

keytool -exportcert -keystore path-to-debug-or-production-keystore -list -v

The Prophet
  • 147
  • 1
  • 4
  • 13
  • Keystore file is not found because you have not generated it? You need to sign your application using android studio which will create a keystorefile with jks extension – Eenvincible Jul 24 '16 at 17:58
  • Yes I just created one and tried again, but still the same error.Maybe I'm using a wrong command? – The Prophet Jul 24 '16 at 18:13
  • If I were you, I would put the keystore,jks file somewhere like Desktop for easy access then run that command again – Eenvincible Jul 24 '16 at 18:14
  • Wait a minute, when you say : keytool -exportcert -keystore path-to-debug-or-production-keystore -list -v, you are specifying the location of your keystore file right? – Eenvincible Jul 24 '16 at 18:18
  • whats ur ide and.studio or eclipse? is ur issue with generating the sha key ? – Charuක Jul 24 '16 at 18:29
  • @Eenvincible I don't know what that means I just copied it from the google developer page(that picture that i posted) that showed me how to get the sha key – The Prophet Jul 24 '16 at 19:13
  • @Charuka I'm using Android Studio and my issue is that I need the sha key, but instead I'm getting an error that I posted . – The Prophet Jul 24 '16 at 19:13
  • for latest version of Android Studio https://stackoverflow.com/questions/27609442/how-to-get-the-sha-1-fingerprint-certificate-in-android-studio-for-debug-mode/67866731#67866731 – Rahul Kushwaha Jun 07 '21 at 06:24

2 Answers2

1

you can get your SHA key from android studio too so no worries

  • open your app in android studio
  • go to the Gradle(in the top right)
  • click on it enter image description here

  • click on your root gradle (which is same to your app name)

  • expand it and expand tasks option inside it

  • now expand android you will see siginingreport inside it enter image description here

  • click on it

  • details will generate for you so refresh your fingers to copy paste it :p

  • you can get it from Run terminal like this and more info too depending that your requirement

  • debug sha key - release sha key - ex date etc..

enter image description here

and finally don't forget to change your as back to run mode in here by click on it :) enter image description here

cheers !

Charuක
  • 12,953
  • 5
  • 50
  • 88
  • It worked, but I don't see any release keys only debug one.Well atleast now I know how to find them :D. – The Prophet Jul 25 '16 at 11:08
  • your app is on debug mode once you change it to release mode you can get that key from terminal too i can tell you that too but search around a bit so its god for learn if its hard add a comment ill show u how :) – Charuක Jul 25 '16 at 11:16
  • I tried it just now by putting the build variant to release and even did the Build Signed Apk and after that I clicked on the signingReport, but it still shows only the debug and debugUnit variant keys and under the release variant it shows "Config: none" – The Prophet Jul 25 '16 at 11:33
  • in your app gradle you can change buildTypes from debug to release search about it you will find it ;) then you can get a release key too – Charuක Jul 25 '16 at 11:35
0

For latest version of Android Studio 4.2 . Follow these steps given in this answer. You will generate SHA Key successfully.

Link:How to get the SHA-1 fingerprint certificate in Android Studio for debug mode?

Rahul Kushwaha
  • 5,473
  • 3
  • 26
  • 30