Android Question Firebase null pointer exception

mc73

Well-Known Member
Licensed User
Longtime User
Following the firebase push notifications' tutorial, I end up with the following error:

B4X:
firebasemessaging_subscribetotopics (java line: 228)
java.lang.NullPointerException: Attempt to invoke virtual method 'void com.google.firebase.iid.FirebaseInstanceId.zza(java.lang.String)' on a null object reference
   at com.google.firebase.messaging.FirebaseMessaging.subscribeToTopic(Unknown Source:100)
   at anywheresoftware.b4a.objects.FirebaseNotificationsService$FirebaseMessageWrapper.SubscribeToTopic(FirebaseNotificationsService.java:130)
   at mc73.testfirebase.firebasemessaging._subscribetotopics(firebasemessaging.java:228)
   at java.lang.reflect.Method.invoke(Native Method)
   at anywheresoftware.b4a.BA.raiseEvent2(BA.java:186)
   at anywheresoftware.b4a.keywords.Common$11.run(Common.java:1154)
   at android.os.Handler.handleCallback(Handler.java:789)
   at android.os.Handler.dispatchMessage(Handler.java:98)
   at android.os.Looper.loop(Looper.java:164)
   at android.app.ActivityThread.main(ActivityThread.java:6938)
   at java.lang.reflect.Method.invoke(Native Method)
   at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
--------- beginning of system

I attach the test project zipped. Any help would be appreciated, thank you.
 

DonManfred

Expert
Licensed User
Longtime User
Upvote 0
Top