FirebaseUI-Android
FirebaseUI-Android copied to clipboard
Firebase AuthUI exception serialization error when logging in with Google
General Information
- Android device: Samsung, Huawei, Hisense, TECNO
- Android OS version: 5,6,7
- Google Play Services version: 16.1.0
- Firebase/Play Services SDK version: 16.0.6
- FirebaseUI version: 4.2.1
Describe the problem:
Some of the users encounter a problem when using Google as their Identity provider. The UI loading indicator on the top of the screen just hangs there and loading goes on forever. Some of them have even a video of the problem. My observations were that there was no error thrown, because what happens when Firebase Auth returns an exception is that it is communicated back to the user uder the form of a dialog. However, in this case we do not receive anything, which means that the block of code which handles logging the exception and presenting an adequate error message is not being called. So the stacktrace which I have pasted below might not actually be the real cause of the problem, however, I have failed to find any other developers encountering the same issue.
Steps to reproduce
- Start the application
- User gets presented with Authentication Screen
- User presses Login with Google button
- Loading indicator hangs
Observed Results:
Crashlytics has logged the following exception:
Non-fatal Exception: com.firebase.ui.auth.FirebaseUiException Exception serialization error, forced wrapping. Original: com.firebase.ui.auth.FirebaseUiException: Play Services update cancelled, original cause: com.google.android.gms.common.api.ApiException: 13: com.firebase.ui.auth.KickoffActivity$2.onFailure (KickoffActivity.java:72) com.google.android.gms.tasks.zzl.run (Unknown Source:4) android.os.Handler.handleCallback (Handler.java:739) android.os.Handler.dispatchMessage (Handler.java:95) android.os.Looper.loop (Looper.java:145) android.app.ActivityThread.main (ActivityThread.java:6934) java.lang.reflect.Method.invoke (Method.java) java.lang.reflect.Method.invoke (Method.java:372) com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:1404) com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1199)
Relevant Code:
val providers = Arrays.asList<AuthUI.IdpConfig>(
AuthUI.IdpConfig.GoogleBuilder().build(),
AuthUI.IdpConfig.FacebookBuilder().build(),
AuthUI.IdpConfig.EmailBuilder().build())
startActivityForResult(
AuthUI.getInstance()
.createSignInIntentBuilder()
.setIsSmartLockEnabled(false)
.setTheme(R.style.GreenTheme)
.setLogo(R.drawable.logo_white_android)
.setAvailableProviders(providers)
.build(),
RC_SIGN_IN
)
Sounds like Google Sign In failed and FirebaseUI just caught and wrapped the exception:
Original: com.firebase.ui.auth.FirebaseUiException: Play Services update cancelled, original cause: com.google.android.gms.common.api.ApiException: 13:
My best guess would be that this happens when the user tries to use Google Sign In, needs to update Play Services, and then the update does not finish.
There's almost definitely nothing you can do about it! There may be something I can do about it but first I need to determine if this is a FirebaseUI bug or a Google Sign In bug.
On Tue, Feb 5, 2019, 9:00 AM AngelStanislavovAngelov < [email protected]> wrote:
Hello Sam,
So this would mean that it is something which occurs from time to time and there is nothing that we can do about it ?
Best regards,
Angel Angelov
On Tue, Feb 5, 2019 at 5:47 PM Sam Stern [email protected] wrote:
Sounds like Google Sign In failed and FirebaseUI just caught and wrapped the exception:
Original: com.firebase.ui.auth.FirebaseUiException: Play Services update cancelled, original cause: com.google.android.gms.common.api.ApiException: 13:
My best guess would be that this happens when the user tries to use Google Sign In, needs to update Play Services, and then the update does not finish.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub < https://github.com/firebase/FirebaseUI-Android/issues/1579#issuecomment-460688136 , or mute the thread < https://github.com/notifications/unsubscribe-auth/AsVNg3mpY5wrg05bWR-DlqHv8p69kH4eks5vKaeKgaJpZM4ai5tS
.
— You are receiving this because you commented.
Reply to this email directly, view it on GitHub https://github.com/firebase/FirebaseUI-Android/issues/1579#issuecomment-460717229, or mute the thread https://github.com/notifications/unsubscribe-auth/AIEw6p8Hm48VDpVdfN-Ym5P_Drlq2Jblks5vKbiggaJpZM4ai5tS .
Alright, please do let me know if there is any resolution to this problem. Thanks!
Having the same issue from time to time. In one of those cases, user had Xiaomi phone and had to enable a Google access for my app in the phone settings or something like that.
I am having this :
Sign in unsuccessful Exception serialization error, forced wrapping. Original: com.firebase.ui.auth.FirebaseUiException: Play Services update cancelled, original cause: com.google.android.gms.common.api. ApiException: 9: Error connecting to Google Play services
when using a huawei phone which does not have google play services ; when I am using a device with google play services, there is no error. What I don't understand is that google play services are no longer required for firebase authentication, so I am wondering what may be the cause !
I have the save exception some times original cause: com.google.android.gms.common.api. ApiException: 9: Error connecting to Google Play services
Hi, @kamdaou Did you manage to figure out the reason for this problem? Some of my app users are reporting the same problem when trying to sign in from Huawei phones. I can't understand either why Firebase throws this exception if Google Play Services is not a requirement for Firebase Auth. Can anyone help with this?
Hi @leocorder Yes, in my case I was using the following code:
startActivityForResult(
AuthUI.getInstance()
.createSignInIntentBuilder()
.setAvailableProviders(providers)
.build(),
MainFragment.SIGN_IN_REQUEST_CODE
)
But AuthUi is a prebuilt UI and probably needs Google Play services. So, I created my UI instead and used a password-based authentication. You could use it for devices that don't have Google Play services. Here is the link for doing that.
Thanks for your quick response @kamdaou. I'm using similar code to initiate the sign in/sign up flow in my app.
Unfortunately I believe the only solution currently would be to actually implement my own UI, as you did, since FirebaseUI depends on Google Play Services, although Firebase Auth does not. Thank you for your help.