Android Firebase:生成发行证书指纹时出错

时间:2018-06-28 04:30:26

标签: firebase android-studio google-oauth google-developers-console

我试图为使用Firebase的Google登录生成发布证书指纹,这是我的问题 这是我的命令:

keytool -exportcert -list -v \
  -alias goworkkey -keystore /home/ryan/Desktop/keystore.jks

这是我的结果:

keytool error: java.lang.Exception: 
Only one command is allowed: both -exportcert and -list were specified.

如果我尝试这样做:

sudo keytool -list -v -keystore /home/ryan/Desktop/keystore.jks -alias googlekey -storepass android -keypass android

我明白了:

keytool error: java.io.IOException: Keystore was tampered with, or password was incorrect
java.io.IOException: Keystore was tampered with, or password was incorrect
    at java.base/sun.security.provider.JavaKeyStore.engineLoad(JavaKeyStore.java:780)
    at java.base/sun.security.util.KeyStoreDelegator.engineLoad(KeyStoreDelegator.java:222)
    at java.base/java.security.KeyStore.load(KeyStore.java:1479)
    at java.base/java.security.KeyStore.getInstance(KeyStore.java:1807)
    at java.base/java.security.KeyStore.getInstance(KeyStore.java:1687)
    at java.base/sun.security.tools.keytool.Main.doCommands(Main.java:908)
    at java.base/sun.security.tools.keytool.Main.run(Main.java:397)
    at java.base/sun.security.tools.keytool.Main.main(Main.java:390)
Caused by: java.security.UnrecoverableKeyException: Password verification failed
    at java.base/sun.security.provider.JavaKeyStore.engineLoad(JavaKeyStore.java:778)
    ... 7 more

3 个答案:

答案 0 :(得分:1)

我在运行命令时遇到了同样的问题:

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

如果我将其更改为此:

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

已正确要求我输入密码,如此处的说明https://developers.google.com/android/guides/client-auth 一切都很好。

答案 1 :(得分:0)

您还有问题吗? youtube video进入“ Gradle项目”标签(在右侧)-> 任务-> android ->双击单击 signingReport ,您将获得所有变体的版本:以具有Variant和Config类型debug的SHA1

希望对您有用!

答案 2 :(得分:0)

  1. 单击Android Studio右侧的项目结构
  2. 点击广告
  3. 勾选 AdMob
  4. 点击确定按钮
  5. 等待同步,或在必要时手动同步。