Android - Firebase Auth Failure

不想你离开。 提交于 2019-12-11 02:50:09

问题


I am developing a simple app. I used Firebase Auth following below document. https://firebase.google.com/docs/auth/android/firebaseui?authuser=0#top_of_page

In debug mode, it works fine. In release mode, I create an Apk file, and install it directly, and it works fine too.

But when I released it into the PlayStore, and download it then it failed.

    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)

I tried to find the Error code 12500, but I cannot. What happened?!

I executed "signinReport" in gradle, and I added the debug and release SHA-1 into the Firebase.

And then I downloaded the "google-services.json".

I am telling again, it works fine in debug apk and release apk. But when I upload the working fine release apk into the PlayStore, it failed.

I really really don't know...


回答1:


Google verifies your signature, removes the signature, and processes the bundle to generate a base APK, configuration APK(s), and dynamic feature APKs (if applicable). And Google re-signs the APKs. So you have to add new SHA-1 sign for your app in Firebase console. Open Google Play Console

Select Release mangement>App signing

Use the provided SHA-1 for firebase.



来源:https://stackoverflow.com/questions/52645607/android-firebase-auth-failure

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!