Search code examples
javaandroidfirebasekeystoresha1

i am unable to generate a SHA1 key following the tutorial from udacity


So I installed a new JDK version, and then installed android SDK. the first step of the tutorial require to create a new app in firebase which requires SHA1 key the tutorial mentions the below to write in cmd

keytool -exportcert -list -v \ -alias androiddebugkey -keystore %USERPROFILE%.android\debug.keystore

but it returns an error that -exportcert and -list both can't be used together, So I removed -exportcert by reviewing few answers here that worked for some people but still it didn't work for me.

A work around which I also tried was to double click the certificate file in gradle which showed an error saying missing keystore.

And below is the final error from Cmd after trying many combinations running from C: and from java directory directly

keytool error: java.lang.Exception: Keystore file does not exist: 
    C:\Users\fadi\.android\debug.keystore
    java.lang.Exception: Keystore file does not exist: C:\Users\fadi\.android\debug.keystore
    at java.base/sun.security.tools.keytool.Main.doCommands(Main.java:899)
    at java.base/sun.security.tools.keytool.Main.run(Main.java:409)
    at java.base/sun.security.tools.keytool.Main.main(Main.java:402)

Solution

  • You need to change directory from

    C:\Users\fadi\.android\debug.keystore 
    
    

    to

    where your keystore file found