2

I am unable to get my SHA1 key on the command prompt. This is what I run.

keytool -list -v -keystore "USERPROFILE\.android\debug.keystore" -alias androiddebugkey -storepass android -keypass android

My command prompt doesn't recognize the keytool.

'keytool' is not recognized as an internal or external command,
operable program or batch file.

I am using windows 10 and android studio 1.5 Any help would be appreciated.

Karan Thakkar
  • 949
  • 4
  • 20
  • 41
  • Possible duplicate of [I can’t find the Android keytool](http://stackoverflow.com/questions/2997348/i-can-t-find-the-android-keytool) – La bla bla Mar 22 '16 at 05:33
  • Locate the directory where java is installed. Add that directory to your path. Alternatively;open your terminal and change directory to the java/bin directory and retry your command. Keytool is located in the java/bin directory. – Skywalker Mar 22 '16 at 05:35

5 Answers5

4

Find the Java installed directory

open terminal and change directory to JDK bin (eg: jdk1.7.0_04\bin)

cd C:\Program Files\Java\jdk1.7.0_04\bin

Now run keytool -list -v -keystore "%USERPROFILE%\.android\debug.keystore"

You will be able to get the debug keystore

Now if Android SHA1 fingerprint for release keystore is required, then command should be changed as follows

keytool -list -v -keystore C:\Users\MeUser\Desktop\test.jks -alias test

where syntax will be like the following

keytool -list -v -keystore {keystore_name} -alias {alias_name}
Sreehari
  • 5,411
  • 2
  • 21
  • 56
1

Its not recognized because keytool has not been added to your environment variables.

Open the bin folder in your java installation folder inside your program files.

  1. C:\Program Files\Java\jdk1.8.0_40\bin

  2. Copy the location in the address bar

  3. Add the location to your environment variables.(if you don't know how follow the next steps)

  4. Right click on the "This PC" when you open your file explorer and choose properties from the options or open a folder and put this in the address bar Control Panel\All Control Panel Items\System

  5. Click on Advanced system settings in the list of options on the left side of your screen and choose environment variables.

  6. In user variables, edit the PATH variable and paste the copied address of the java bin folder. Put a semi-colon ; at the end of the statement you are editing before pasting your address if its not there already.

  7. Open command prompt again (as admin) and try it again.

Hope this works for you.

Naj
  • 228
  • 1
  • 10
0
  1. open android studio.
  2. go to gradle in right side tolbar.
  3. open android and signingreport and double click it.

this will run and give you the sha1 fingerprint.

this is a picture of signingreport in android studio

the output will be displayed in terminal .

let me know if this solves your problem.

Sagar Nayak
  • 1,997
  • 2
  • 17
  • 41
0

try type in the full path of /.android.....

c:\users\{yourUserName}\.android\debug.keystore

worked for me :)

Moshe Edri
  • 228
  • 2
  • 10
0

If You Are Here Trying To Use Google Sign in On A Flutter App, need an SHA1 There Is No Gradle Button In Flutter.

-Open A New Project

-Google Maps Activity

-Run The Project

-Gradle on left window

-My Application

-Tasks

-Android

-CLICK => signingReport

Now Scroll Through My Application Signing report it is there

Alias: AndroidDebugKey

MD5: xx:xx:xx:xx:xx:xx:xx:xx:xx

SHA1: xx:xx:xx:xx:xx:xx:xx:xx:xx

SHA-256: xx:xx:xx:xx:xx:xx:xx:xx:xx

Hope This Helps