4

I'm trying to use my debug keystore so I can get a key for a map view, but when I try and use it, it comes up with this

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

Im ussing this:

keytool -v -list -keystore "C:\Users\MyPcName.android\debug.keystore"

When I try to use:

keytool -list -alias androiddebugkey \ -keystore <path_to_debug_keystore>.keystore \ -storepass android -keypass android

it comes up with

C:\Program Files\Java\jdk1.7.0_04\bin>keytool -list -alias androiddebugkey \ -k
ystore B:\Fabian\.android\.keystore \ -storepass android -keypass android
Illegal option:  \
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
 -storepass <arg>                keystore password
 -storetype <storetype>          keystore type
 -providername <providername>    provider name
 -providerclass <providerclass>  provider class name
 -providerarg <arg>              provider argument
 -providerpath <pathlist>        provider classpath
 -v                              verbose output
 -protected                      password through protected mechanism

Use "keytool -help" for all available commands
Cœur
  • 32,421
  • 21
  • 173
  • 232
FabianCook
  • 18,692
  • 14
  • 59
  • 110

5 Answers5

5

Try giving keytool path from gre. It worked for me.

C:\Program Files\Java\Jre7\bin>keytool -list -alias androiddebugkey -keystore
 "C:\Uers\Akki\.android\debug.keystore" -storepass android -keypass android

If you have installed Jdk 1.7 it will generate SHA1 key which will not work for that use -v

C:\Program Files\Java\Jre7\bin>keytool -v -list -alias androiddebugkey -keystore "C:\Uers\Akki.android\debug.keystore" -storepass android -keypass android

Akshay Purey
  • 51
  • 1
  • 2
  • thanks, you are right, for some reason it works with the JRE instead of the JDK, I am using JDK version 1_8_92 – PirateApp Apr 30 '16 at 10:23
3

Here is actually what you have to use to get a map api key :

$ keytool -v -list -alias androiddebugkey \ -keystore <path_to_debug_keystore>.keystore \ -storepass android -keypass android

Here you can find a lot information about this. It's working for me : get Google Maps Api KEy

EDIT: On Windows using command prompt go to this folder :

C:\Program Files\Java\jre6\bin

and type the code above. It should generate you a key which you have to paste here : GET API KEY

Android-Droid
  • 13,649
  • 37
  • 107
  • 184
1

my debug keystore so I can get a key for a map view

First of all is it (C:\Users\MyPcName.android\debug.keystore) your app keystore?

And check your keytool path.

keytool -v -list -alias YOURAPPaliasName -keystore "here your keystore path" 
Samir Mangroliya
  • 38,074
  • 16
  • 111
  • 131
0

here is what worked for me, my command prompt at jre bin folder :

c:\Program Files\Java\jre1.8.0_144\bin>keytool.exe -v -list -alias androiddebugkey  -keystore c:\Users\<UserDirectory>\.android\debug.keystore  -storepass android -keypass android
Brainwash
  • 127
  • 1
  • 7
0

This is what worked for me. Add path
[C:\Program Files\Java\jdk-13.0.1\bin(check your path, it may be different)]
to your environment variable.

then run this code in command prompt(EDIT://enterYourPcUsername\ in the code)

keytool -v -list -alias androiddebugkey  -keystore c:\Users\<enterYourPcUsername>\.android\debug.keystore  -storepass android -keypass android