0

I just finished integrating Firebase real time data base and Authentication into my Android Studio application. It ran successfully two or three times on my Google Nexus 7 genymotion emulator that has google play services on it. Then I tried launching it again and I started getting the below error:

06-25 16:50:46.994 7699-7699/
com.careersvirtualsolutions.uprate E/AndroidRuntime: 
FATAL EXCEPTION: main
java.lang.NullPointerException
at com.google.firebase.auth.FirebaseAuth$1.run(Unknown Source)
at android.os.Handler.handleCallback(Handler.java:730)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5103)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
at dalvik.system.NativeStart.main(Native Method)

I think this has something to do with the Firebase Authentication SDK but I am not sure. Do you know what this is caused by? How can I solve it?

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
Caira
  • 31
  • 5

1 Answers1

2

I actually figured it out, the problem was with the AuthStateListener. So if you're having a similar issue, try testing your project with the AuthStateListener commented out and see if it launches without crashing. If it does you can then figure out how to replace the existing listener.

Hope this helps in some way!

Caira
  • 31
  • 5