我正在开发一个简单的应用程序。
我按照下面的文档使用了 Firebase Auth。https://firebase.google.com/docs/auth/android/firebaseui?authuser=0#top_of_page 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)
我试图找到错误代码 12500,但找不到。
发生了什么?!
我在 gradle 中执行了“signinReport”,并将调试和发布 SHA-1 添加到 Firebase 中。
然后我下载了“google-services.json”。
我再说一遍,它在调试 apk 和发布 apk 中工作得很好。
但是当我将工作正常的发布 apk 上传到 PlayStore 时,它失败了。
我真的真的不知道...