yoo*_*hok 3 android firebase firebase-authentication
我正在开发一个简单的应用程序。我在以下文档中使用了 Firebase Auth。 https://firebase.google.com/docs/auth/android/firebaseui?authuser=0#top_of_page
在调试模式下,它工作正常。在发布模式下,我创建了一个Apk文件,然后直接安装,它也运行良好。
但是当我将它发布到 PlayStore 并下载它时,它失败了。
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent) {
super.onActivityResult(requestCode, resultCode, data)
if (requestCode == RC_SIGN_IN) {
val response = IdpResponse.fromResultIntent(data)
if (resultCode == Activity.RESULT_OK) {
val user = FirebaseAuth.getInstance().currentUser
info("onActivityResult - ${user!!.email}")
mPresenter.isAlreadyExistUser(user!!.email!!)
} else {
error("signIn failed - ${response!!.error}") <-- Only when I downloaded it from playstore, it failed...
response!!.error!!.printStackTrace()
}
}
}
W/System.err: com.firebase.ui.auth.FirebaseUiException: Code: 12500, message: 12500:
W/System.err: at com.firebase.ui.auth.data.remote.GoogleSignInHandler.onActivityResult(GoogleSignInHandler.java:106)
W/System.err: at com.firebase.ui.auth.ui.idp.SingleSignInActivity.onActivityResult(SingleSignInActivity.java:121)
Run Code Online (Sandbox Code Playgroud)
我试图找到错误代码 12500,但我找不到。发生了什么?!
我在 gradle 中执行了“signinReport”,并在 Firebase 中添加了调试和发布 SHA-1。
然后我下载了“google-services.json”。
我再说一遍,它在调试 apk 和发布 apk 中工作正常。但是当我将工作正常的发行版 apk 上传到 PlayStore 时,它失败了。
我真的不知道...
Google 会验证您的签名、删除签名并处理捆绑包以生成基本 APK、配置 APK 和动态功能 APK(如果适用)。并且 Google 重新签署了 APK。因此,您必须在 Firebase 控制台中为您的应用添加新的 SHA-1 标志。打开Google Play 管理中心
将提供的SHA-1用于 firebase。
归档时间: |
|
查看次数: |
1430 次 |
最近记录: |