首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >谷歌signIn ApiException: 10:

谷歌signIn ApiException: 10:
EN

Stack Overflow用户
提问于 2019-07-10 02:28:50
回答 1查看 154关注 0票数 2

我一直在遵循this在我的应用程序中实现谷歌登录。我遵循了每一步,在firebase和应用程序中设置了我的SHA1和web cliednt id。

发生了什么:我点击按钮登录谷歌,出现谷歌提示,我选择propmt关闭的帐户。

我在这里和那里放了一些祝酒词,看看代码在哪里被卡住了

代码语言:javascript
复制
  @Override
    public void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);

        // Result returned 

from launching the Intent from GoogleSignInApi.getSignInIntent(...);
    if (requestCode == GOOGLE_SIGN) {
        Task<GoogleSignInAccount> task = GoogleSignIn.getSignedInAccountFromIntent(data);
        try {
            // Google Sign In was successful, authenticate with Firebase
            GoogleSignInAccount account = task.getResult(ApiException.class);
            firebaseAuthWithGoogle(account);
        } catch (ApiException e) {
            alert("You suck even more"); <---THIS ONE
            // Google Sign In failed, update UI appropriately
            // ...
        }
    }
}

将显示捕获器中的吐司(ApiException e)。为什么它会卡在onActivityResult上?

下面是gradle:

代码语言:javascript
复制
 dependencies {
implementation 'com.google.firebase:firebase-core:17.0.0'
    implementation 'com.google.firebase:firebase-auth:17.0.0'
    implementation 'com.google.firebase:firebase-storage:17.0.0'
    implementation 'com.firebaseui:firebase-ui-storage:4.1.0'
    implementation 'com.firebaseui:firebase-ui-database:4.1.0'
    implementation 'com.google.android.gms:play-services-auth:15.0.1'


}

apply plugin: 'com.google.gms.google-services'

或者至少是与谷歌相关的。

我已经关注了关于这个aPI异常的所有内容,但是没有任何帮助。见鬼,我甚至因为沮丧而删除了整个Firebase项目,并重新创建了它,并做了this……但是什么都没有..。我甚至不能这样做,因为我不能在Google Dev和Firebase中放入相同的SHA1,我会得到一个d uplicate的提示请,这肯定比这简单得多,我想我现在只是想多了

请帮帮我,我花了5个小时才看完github的问题。

EN

回答 1

Stack Overflow用户

发布于 2019-07-10 02:42:01

您是否添加了支持电子邮件地址。因为这是我们在设置firebase时常用的方法。如果没有支持电子邮件地址,我们可以从firebase获得所需的结果

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/56958656

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档