Google登录错误状态{statusCode = DEVELOPER_ERROR,分辨率=空} [英] Google sign in error Status{statusCode=DEVELOPER_ERROR, resolution=null}

查看:1038
本文介绍了Google登录错误状态{statusCode = DEVELOPER_ERROR,分辨率=空}的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我通过以下线程将gmail登录集成到我的android应用程序中:

https://developers.google.com/identity/sign-in/android/sign-in?configured = true

但是我收到错误消息:

状态{statusCode = DEVELOPER_ERROR,分辨率=空}

我在这里浏览了此状态代码文档:

https://developers. google.com/android/reference/com/google/android/gms/common/ConnectionResult.html#DEVELOPER_ERROR

上面的链接无助于诊断问题,

我已创建调试密钥库文件&使用keytool生成的SHA-1,也在Google Developer Console中,我在清单文件或gradle文件中添加了程序包名称.

但是所有人似乎都失败了,谁能告诉我这个错误代码表明什么地方可能出问题了?

解决方案

问题是SHA1不匹配,

1]第一个密钥库文件:我解决了该错误,问题是在构建apk Android Studio时正在使用位于C:\Users\<LOGGED_IN_USER_NAME>\.android\debug.keystore

内的默认密钥库文件

2]第二个密钥库文件:另外,我还创建了另一个密钥库文件,该文件位于不同的目录,即app/keystore/debug.keystore

在将google开发人员控制台配置为在应用程序中集成gmail登录时,我给出了通过上面的第二个密钥库文件生成的sha-1密钥,而Studio在构建包含其他密钥库文件的apk文件时发生了sha-1密钥不匹配的情况. >

为了获取位于@ app/keystore/debug.keystore的密钥库文件,我使用以下代码在应用程序级别配置了gradle文件:

signingConfigs {
        debug {
            storeFile file('keystore/debug.keystore')
            keyAlias 'androiddebugkey'
            keyPassword 'android'
            storePassword 'android'
        }
        /*
        release {
            storeFile file('release.keystore')
            storePassword "mystorepassword"
            keyAlias "mykeyalias"
            keyPassword "mykeypassword"
        }
        */

现在,生成的apk sha-1签名与在Google开发者控制台上为您的应用配置的sha-1密钥匹配.

一个注意事项:始终使用debug.keystore调试gmail集成(在开发时).

参考:

对于gmail集成: https://developers.google.com/identity/sign-in/android /start-integrating

要查看哪种sha-1正在为您的应用程序使用,请参阅以下stackoverflow线程: 密钥存储区证书的SHA-1指纹

I am integrating gmail login in my android application by following this thread :

https://developers.google.com/identity/sign-in/android/sign-in?configured=true

But I am getting error as :

Status{statusCode=DEVELOPER_ERROR, resolution=null}

I looked through this status code documentation here :

https://developers.google.com/android/reference/com/google/android/gms/common/ConnectionResult.html#DEVELOPER_ERROR

Above link does not help to diagnose the problem,

I have created the debug keystore file, & generated SHA-1 using keytool, also in Google developer console, I added package name as it is in manifest file or gradle file.

But all seems to fail can anybody tell me what does this error code suggest what may go wrong ?

解决方案

Problem was SHA1 mismatch,

1] First Keystore File : I solved the error, problem was while building apk Android studio was taking default keystore file which was located inside C:\Users\<LOGGED_IN_USER_NAME>\.android\debug.keystore

2] Second Keystore File : Also I created one other keystore file which was located at different directory i.e. app/keystore/debug.keystore

While configuring the google developer console to integrate gmail login within app I gave sha-1 key generated through second keystore file above, the studio while building the apk file taking other keystore file hence sha-1 key mismatch was happening.

In order to take my keystore file located @ app/keystore/debug.keystore I configured gradle file at app level with following code :

signingConfigs {
        debug {
            storeFile file('keystore/debug.keystore')
            keyAlias 'androiddebugkey'
            keyPassword 'android'
            storePassword 'android'
        }
        /*
        release {
            storeFile file('release.keystore')
            storePassword "mystorepassword"
            keyAlias "mykeyalias"
            keyPassword "mykeypassword"
        }
        */

Now the generated apk sha-1 signature matches with the sha-1 key configured on google developer console for your app.

One note : Always use debug.keystore for debugging the gmail integration (At the time of development).

Refs :

For gmail integration : https://developers.google.com/identity/sign-in/android/start-integrating

To see which sha-1 is getting used for your application see this stackoverflow thread : SHA-1 fingerprint of keystore certificate

这篇关于Google登录错误状态{statusCode = DEVELOPER_ERROR,分辨率=空}的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆