无法从终端获取SHA-1指纹

时间:2016-07-24 17:53:40

标签: android google-play-services sha1

这就是enter image description here

所需要的

但是我收到了这个错误:

keytool error:java.lang.Exception:密钥库文件不存在:path-to-debug-or-production-keystore java.lang.Exception:密钥库文件不存在:path-to-debug-or-production-keystore         at sun.security.tools.keytool.Main.doCommands(Main.java:742)         在sun.security.tools.keytool.Main.run(Main.java:340)         在sun.security.tools.keytool.Main.main(Main.java:333)

这是我的keytool是c:\ Program Files \ Java \ jdk1.8.0_65 \ bin>的地方。     ,所以我很确定在将命令应用到终端时我在正确的目录中。

编辑:我在终端中使用了这个命令:

keytool -exportcert -keystore path-to-debug-or-production-keystore -list -v

2 个答案:

答案 0 :(得分:0)

你也可以从android studio获得你的SHA密钥,所以不用担心

  • 在android studio中打开你的应用
  • 转到Gradle(右上角)
  • 点击它 enter image description here

  • 点击您的根gradle(与您的应用名称相同)

  • 展开它并展开其中的任务选项

  • 现在展开android,你会在里面看到 siginingreport enter image description here

  • 点击它

  • 将为您生成详细信息,请刷新您的手指以复制粘贴它:p

  • 你可以从这样的Run终端获取它,也可以根据你的要求获得更多信息

  • debug sha key - 释放sha键 - ex date等..

enter image description here

最后不要忘记通过点击它来改变你的回到运行模式:) enter image description here

欢呼!

答案 1 :(得分:0)

适用于最新版本的 Android Studio 4.2。请按照此答案中给出的这些步骤操作。 您将成功生成 SHA 密钥。

链接How to get the SHA-1 fingerprint certificate in Android Studio for debug mode?

相关问题