Firebaseui-android: NullPointerException on saveCredentialsOrFinish (2.0.1)

Created on 8 Aug 2017  ยท  11Comments  ยท  Source: firebase/FirebaseUI-Android

Even after 2.0 I am still seeing such error and I don't know exactly why. It happens after creating a new account using email. Here's a copy of crash report (firebase)

com.google.android.gms.common.internal.af.a ()
com.google.android.gms.internal.aio.<init> ()
com.google.android.gms.common.api.e$a.a ()
com.firebase.ui.auth.util.signincontainer.SaveSmartLock.saveCredentialsOrFinish (SaveSmartLock.java:221)
com.firebase.ui.auth.ui.BaseHelper.saveCredentialsOrFinish (BaseHelper.java:113)
com.firebase.ui.auth.ui.email.RegisterEmailFragment$3$1.onComplete (RegisterEmailFragment.java:237)
com.google.android.gms.c.o.run ()
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:7007)
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)

Manufacturer: Samsung
Model: SM-J320M
Board: Sc9830i
Android API: 22
Android OS: 5.1.1
Brand: Samsung
RAM: 1.33GB
Orientation: Portrait
Proximity to user: โ€”

Dependencies:
compile 'com.firebaseui:firebase-ui-auth:2.0.1'

Smells like a bug, doesn't it?

auth fix-implemented bug

Most helpful comment

@abhinavsingh That should be irrelevant since we're using the support libraries. Either way, we're rewriting FirebaseUI into a new age of stability. ๐Ÿ˜„ Thanks for trying to help though!

All 11 comments

Hey, could you try reproducing this error on the latest version of FirebaseUI, 2.2.0?

@victoraldir Thanks for the bug report, I've got all the info I need! ๐Ÿ˜„

The right line of code is here.

@TheCraftKid The problem is that this listener can complete after the Activity dies. Unfortunately there isn't really an easy fix for this. I think we'll have to just scope the listener to the activity's lifecycle, but that cancels the sign-in. ๐Ÿ˜• I guess that's better than crashing and leaving the sign-in in an even weirder state.

Just in general, I'd like to work on massively improving how FirebaseUI handles rotations while signing in. TBH, it's kinda terrible right now. ๐Ÿ˜† Sometimes it crashes, other times the sign-in doesn't complete, and very rarely does it actually work if a config change occurs. I think Android Architecture Components could be a _massive_ help with this which is really existing! ๐Ÿ˜„ But for now, we can at least fix the crashes.

@SUPERCILEX did you have an idea for how to fix this in the short term without that big refactor? Or should I take a stab?

@samtstern Nope, I just really want to get rid of retained fragments. ๐Ÿ˜„ If you can come up with a quick fix though, that would be cool!

Hi!
Any news on this? I currently have a bunch of users facing this crash.
bitmoji

@thelong1EU I've actually just started working on a major refactor that gets rid of this class and fixes just about a billion different config change bugs. I'm hoping for it to be ready for a PR by the end of the week.

FWIW, this happens on API 25 _(not for 23 or 26)_.
I am working with Emulators.

@abhinavsingh That should be irrelevant since we're using the support libraries. Either way, we're rewriting FirebaseUI into a new age of stability. ๐Ÿ˜„ Thanks for trying to help though!

Thanks for your work. You are wonderful!

On Oct 13, 2017 7:18 AM, "Alex Saveau" notifications@github.com wrote:

@abhinavsingh https://github.com/abhinavsingh That should be irrelevant
since we're using the support libraries. Either way, we're rewriting
FirebaseUI https://github.com/firebase/FirebaseUI-Android/pull/962 into
a new age of stability. ๐Ÿ˜„ Thanks for trying to help though!

โ€”
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/firebase/FirebaseUI-Android/issues/856#issuecomment-336346260,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AI2nVjBhWgRmPKlzyCfLkbvJ0RtNUeJUks5sruSBgaJpZM4Owi3_
.

Not sure if this is related but looks involves smartlock in the trace - I just found this bug report in my Fabric Crashlytics from a day ago:
Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.app.Activity.setResult(int, android.content.Intent)' on a null object reference
at com.firebase.ui.auth.ui.BaseHelper.createBaseIntent(Unknown Source)
at com.firebase.ui.auth.ui.FragmentHelper.getFlowParamsBundle(Unknown Source)
at com.firebase.ui.auth.ui.FragmentBase.finish(Unknown Source)
at com.firebase.ui.auth.util.signincontainer.SaveSmartLock.finish(Unknown Source)
at com.firebase.ui.auth.util.signincontainer.SaveSmartLock.getInstance(Unknown Source)
at com.firebase.ui.auth.ui.BaseHelper.createBaseIntent(Unknown Source)
at com.firebase.ui.auth.ui.BaseHelper.createBaseIntent(Unknown Source)
at com.firebase.ui.auth.ui.idp.CredentialSignInHandler.onComplete(Unknown Source)
at com.google.android.gms.tasks.zzf.run(Unknown Source)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

Was probably using firebase*11.0.4

This has been fixed and released in version 3.2.0.

Was this page helpful?
0 / 5 - 0 ratings