Google登录会引发异常com.google.android.gms.common.api.ApiException:12500 [英] Google Sign In throws an exception com.google.android.gms.common.api.ApiException: 12500

查看:1129
本文介绍了Google登录会引发异常com.google.android.gms.common.api.ApiException:12500的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个用Android编写的简单应用程序,我想在其中执行Google Sign,然后执行Firebase身份验证.我从官方页面复制粘贴代码.

I have a simple application written in Android, where I want to do Google Sign and then Firebase Authentication. I copy paste the code from official page.

val gso = GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
    .requestIdToken(getString(R.string.default_web_client_id))
    .requestEmail()
    .build()

if (requestCode == REQUEST_CODE_GOOGLE_SIGN_IN) {
    val task = GoogleSignIn.getSignedInAccountFromIntent(data)
    try {
        // Google Sign In was successful, authenticate with Firebase
        val account = task.getResult(ApiException::class.java)
        firebaseAuthWithGoogle(account.idToken!!)
    } catch (e: ApiException) {
        // Google Sign In failed, update UI appropriately
        Log.w("aaa", "Google sign in failed", e)
        // ...
    }
}

但是这个简单的代码引发了异常com.google.android.gms.common.api.ApiException: 12500:

But this simple code is throwing an exception com.google.android.gms.common.api.ApiException: 12500:

问题是什么,我检查了在线资源,每个人都在说添加支持电子邮件,添加应用程序图标,但是要添加应用程序图标,我需要经过OAuth验证过程,该过程会询问很多我目前没有的数据在我刚开始开发应用程序时,请帮助我尝试解决这个问题已有48个小时.

What is an issue, I checked online sources everyone is saying add support email, add application icon, but to add application icon I need to go through the OAuth verification process, which asks a lot of data which I currently do not have as I just started to develop my application, please help I am trying to solve this issue already for 48 hours.

推荐答案

因为至少在我将其上传到商店之前,它已经可以正常工作

because at least it was working before I uploaded it to play store

问题(名为 Play应用签名的功能)

似乎Google Play商店正在为您的应用而不是您签名,因此Firebase会检测到不同的签名密钥,并阻止身份验证.重新签名应用程序是 Google Play商店功能,而阻止通过对您尚未验证的密钥签名的应用进行Firebase身份验证是 Firebase功能.

Problem (a feature called Play App Signing)

It seems like the Google Play Store is signing your app instead of you, so Firebase detects a different signing key, and prevents authentication. Re-signing apps is a Google Play Store feature, and preventing apps signed by signing keys which you haven't verified from authenticating with Firebase is a Firebase feature.

转到Google Play商店控制台→设置→应用签名→App signing key certificate,复制SHA -1证书指纹.

Go to Google Play Store Console → Setup → App Signing → App signing key certificate, copy the SHA-1 certificate fingerprint.

然后转到 Firebase控制台→项目设置→您的应用程序→添加指纹→并粘贴 SHA1 .

Then go to Firebase Console → Project Settings → Your Apps → Add Fingerprint → and paste the SHA1.

告诉Firebase接受从由Google Play商店处理的密钥签名的应用生成的身份验证请求.以前,它仅接受来自本地签名应用程序签名的应用程序的请求,该密钥存储在您的计算机上.

Telling Firebase to accept authentication requests generated from an app signed by the key handled by Google Play Store. It previously only accepted requests from an app signed by your locally signed app, where the key is stored on your computer.

这篇关于Google登录会引发异常com.google.android.gms.common.api.ApiException:12500的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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