H Hamied Abou Hulaikah Well-Known Member Licensed User Longtime User Jun 27, 2018 #1 I'm using b4a 8.30 I update all necessary things according to: https://www.b4x.com/android/forum/threads/updates-to-internal-libraries.59340/#post-591400 I'm following this tutorial: https://www.b4x.com/android/forum/t...s-firebase-cloud-messaging-fcm.67716/#content In b4a 7.x it working fine, but in b4a 8+ when i call SubscribeToTopic function: Code: Copy fm.SubscribeToTopic("newstopic") i get this error: Code: Copy java.lang.RuntimeException: java.lang.NullPointerException: Attempt to invoke virtual method 'com.google.android.gms.tasks.Task com.google.firebase.iid.FirebaseInstanceId.zza(java.lang.String)' on a null object reference at anywheresoftware.b4a.keywords.Common$13.run(Common.java:1682) 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:6682) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410) Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'com.google.android.gms.tasks.Task com.google.firebase.iid.FirebaseInstanceId.zza(java.lang.String)' on a null object reference at com.google.firebase.messaging.FirebaseMessaging.subscribeToTopic(Unknown Source) at anywheresoftware.b4a.objects.FirebaseNotificationsService$FirebaseMessageWrapper.SubscribeToTopic(FirebaseNotificationsService.java:130) at com.yemenet.phonezclub.firebasemessaging$ResumableSub_Service_Start.resume(firebasemessaging.java:236) at anywheresoftware.b4a.keywords.Common$13.run(Common.java:1680) ... 7 more How can be solved?
I'm using b4a 8.30 I update all necessary things according to: https://www.b4x.com/android/forum/threads/updates-to-internal-libraries.59340/#post-591400 I'm following this tutorial: https://www.b4x.com/android/forum/t...s-firebase-cloud-messaging-fcm.67716/#content In b4a 7.x it working fine, but in b4a 8+ when i call SubscribeToTopic function: Code: Copy fm.SubscribeToTopic("newstopic") i get this error: Code: Copy java.lang.RuntimeException: java.lang.NullPointerException: Attempt to invoke virtual method 'com.google.android.gms.tasks.Task com.google.firebase.iid.FirebaseInstanceId.zza(java.lang.String)' on a null object reference at anywheresoftware.b4a.keywords.Common$13.run(Common.java:1682) 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:6682) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410) Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'com.google.android.gms.tasks.Task com.google.firebase.iid.FirebaseInstanceId.zza(java.lang.String)' on a null object reference at com.google.firebase.messaging.FirebaseMessaging.subscribeToTopic(Unknown Source) at anywheresoftware.b4a.objects.FirebaseNotificationsService$FirebaseMessageWrapper.SubscribeToTopic(FirebaseNotificationsService.java:130) at com.yemenet.phonezclub.firebasemessaging$ResumableSub_Service_Start.resume(firebasemessaging.java:236) at anywheresoftware.b4a.keywords.Common$13.run(Common.java:1680) ... 7 more How can be solved?
DonManfred Expert Licensed User Longtime User Jun 27, 2018 #2 Did you updated the internal firebase libraries? Did you update the manifest code to use the new short oneliners? Upvote 0
Did you updated the internal firebase libraries? Did you update the manifest code to use the new short oneliners?
Alex Guerrero Member Licensed User Longtime User Jun 27, 2018 #3 Hi, try eliminating the end of line. Code: Copy fm.SubscribeToTopic(topic.replace("\n", "")) Upvote 0
H Hamied Abou Hulaikah Well-Known Member Licensed User Longtime User Jun 27, 2018 #4 DonManfred said: Did you update the manifest code to use the new short oneliners? Click to expand... I added this and worked fine ... thank you Code: Copy CreateResourceFromFile(Macro, FirebaseAnalytics.GooglePlayBase) CreateResourceFromFile(Macro, FirebaseAnalytics.Firebase) CreateResourceFromFile(Macro, FirebaseNotifications.FirebaseNotifications) Upvote 0
DonManfred said: Did you update the manifest code to use the new short oneliners? Click to expand... I added this and worked fine ... thank you Code: Copy CreateResourceFromFile(Macro, FirebaseAnalytics.GooglePlayBase) CreateResourceFromFile(Macro, FirebaseAnalytics.Firebase) CreateResourceFromFile(Macro, FirebaseNotifications.FirebaseNotifications)