3

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...

yoonhok
  • 2,575
  • 2
  • 30
  • 58

1 Answers1

5

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 enter image description here

Use the provided SHA-1 for firebase.

deepak raj
  • 3,331
  • 1
  • 12
  • 20
  • You mean, Should I copy the step 3's SHA-1 and paste it into the Firebase console? And then re-download "google-services.json" and re-generate signed apk? – yoonhok Oct 04 '18 at 11:46
  • 1
    No, you just got firebase console and select your project and the open your **Project Settings** and add this as _SHA certificate fingerprint_ and save it. – deepak raj Oct 04 '18 at 12:19
  • Really really Thank you! – yoonhok Oct 04 '18 at 12:44