Rafael Carlos
Rafael Carlos

Reputation: 86

Error Generating Certificate SHA-1

I'm trying to integrate my app with the Google API. For this you need to provide the sha-1 of the signing certificate.

At the command prompt, I use the following command provided by Google:

keytool -exportcert -list -v \
-alias <your-key-name> -keystore <path-to-production-keystore>

With this, I get the following error:

erro de keytool: java.lang.Exception: O arquivo da área de armazenamento de chaves não existe. %shang%\.android\debug.keystore
java.lang.Exception: O arquivo da área de armazenamento de chaves não existe. %shang%\.android\debug.keystore
        at sun.security.tools.keytool.Main.doCommands(Main.java:745)
        at sun.security.tools.keytool.Main.run(Main.java:343)
        at sun.security.tools.keytool.Main.main(Main.java:336)

However, the debug.keystore file exists.

enter image description here

Upvotes: 1

Views: 2208

Answers (2)

Piash Sarker
Piash Sarker

Reputation: 466

For SHA1 Debug Key , run below command in android studio terminal.

Mac/Linux :

 keytool -exportcert -list -v \
-alias androiddebugkey -keystore ~/.android/debug.keystore

Windows :

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

Replace the %USERPROFILE% with your user path .

The Password is default : android

Upvotes: 2

Anmol317
Anmol317

Reputation: 1376

You can generate the SHA-1 key from the studio itself, without using the terminal like this :

  • Click on gradle placed at right side of the studio

  • Click on refreshAllGradleProjects button

  • go to app

  • android

  • doble click on signingReport

SHA-1 key will be generated.

Upvotes: 0

Related Questions