0

I am trying to get a SHA1 key for Firebase and have tried to use the command

Jim Johnson is a dummy name btw

keytool -list -v -keystore C:\Users\Jim Johnson\.android\debug.keystore -alias androiddebugkey -storepass android -keypass android

And I have pretty much checked everything else (keytool works and environmental variables all checked) but I get an error of

Illegal option:  Johnson\.android\debug.keystore
keytool -list [OPTION]...

Lists entries in a keystore

Options:

 -rfc                    output in RFC style
 -alias <alias>          alias name of the entry to process
 -keystore <keystore>    keystore name
 -cacerts                access the cacerts keystore
 -storepass <arg>        keystore password
 -storetype <type>       keystore type
 -providername <name>    provider name
 -addprovider <name>     add security provider by name (e.g. SunPKCS11)
   [-providerarg <arg>]    configure argument for -addprovider
 -providerclass <class>  add security provider by fully-qualified class name
   [-providerarg <arg>]    configure argument for -providerclass
 -providerpath <list>    provider classpath
 -v                      verbose output
 -protected              password through protected mechanism

Use "keytool -?, -h, or --help" for this help message

I think it it because I have a space in my name. Haven't seen the people in the tutorials I watched use a space in their name.

Any way to get arond this?

  • You basically fail to properly quote a command line argument. The space in the path name is taken as a separator between command line arguments. To avoid this you have to quote the path. – Steffen Ullrich Jan 30 '21 at 18:10

2 Answers2

3

Quotes. "C:\Users\Jim Johnson\.android\debug.keystore" will get the job done.

rzwitserloot
  • 85,357
  • 5
  • 51
  • 72
  • This works, kind of. Apprently I also dont have `debug.keystore` in the '.android' folder... –  Jan 30 '21 at 18:14
1

If you are using android studio, you can easily find your SHA-1 key by opening your project and selecting Gradle from the right side-bar (see image below). Gradle should be available for selection on the right.

Next, follow the folder path Tasks -> android and then double-click signingReport.

Android studio should provide you with several keys, one of which is the SAH-1 you are looking for. This is much easier than using the command line.

screen clipping from android studio on Windows