Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android: NullPointerException on NetworkInfo.isConnected() with Firebase

Sometimes, on different mobiles (Android 7) there is this crash:

Fatal Exception: java.lang.RuntimeException: Error receiving broadcast Intent { act=android.net.conn.CONNECTIVITY_CHANGE flg=0x4000010 (has extras) } in com.google.firebase.iid.zzae@3c68978
       at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:1178)
       at android.os.Handler.handleCallback(Handler.java:751)
       at android.os.Handler.dispatchMessage(Handler.java:95)
       at android.os.Looper.loop(Looper.java:154)
       at android.app.ActivityThread.main(ActivityThread.java:6321)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
Caused by java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.net.NetworkInfo.isConnected()' on a null object reference
       at com.google.firebase.iid.zzad.zzchr(Unknown Source)
       at com.google.firebase.iid.zzae.onReceive(Unknown Source)
       at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:1163)
       at android.os.Handler.handleCallback(Handler.java:751)
       at android.os.Handler.dispatchMessage(Handler.java:95)
       at android.os.Looper.loop(Looper.java:154)
       at android.app.ActivityThread.main(ActivityThread.java:6321)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)

Have you seen this error before? I don't know how to correct this bug...

Thank you very much guys!

like image 956
anthony Avatar asked Dec 05 '17 09:12

anthony


1 Answers

The issue has been fixed in 11.8.0 . Please update your Firebase SDK version. Refer https://firebase.google.com/support/release-notes/android#20171218

like image 184
Harshit Jain Avatar answered Nov 15 '22 22:11

Harshit Jain