Android Question Firebase B4A 8.3

jayel

Active Member
Licensed User
Longtime User
Hello,

existing app working with B4A 7.0 now compiled with B4A 8.3 giving error.
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)
Copying updated assets files (59)
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
wissen van data groter dan 30 dagen
** Activity (main) Resume **
*** Service (firebasemessaging) Create ***
** Service (firebasemessaging) Start **
*** Service (httputils2service) Create ***
** Service (httputils2service) Start **
java.lang.NoSuchMethodError: No virtual method subscribeToTopic(Ljava/lang/String;)Lcom/google/android/gms/tasks/Task; in class Lcom/google/firebase/messaging/FirebaseMessaging; or its super classes (declaration of 'com.google.firebase.messaging.FirebaseMessaging' appears in /data/app/be.robotronic.robonotification-BqRriTOpmAZRJ9pOfdsLUw==/base.apk)
at anywheresoftware.b4a.objects.FirebaseNotificationsService$FirebaseMessageWrapper.SubscribeToTopic(FirebaseNotificationsService.java:130)
at be.robotronic.robonotification.firebasemessaging._subscribetotopics(firebasemessaging.java:774)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:735)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:357)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:260)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
at anywheresoftware.b4a.BA$2.run(BA.java:365)
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 crash
java.lang.RuntimeException: java.lang.NoSuchMethodError: No virtual method subscribeToTopic(Ljava/lang/String;)Lcom/google/android/gms/tasks/Task; in class Lcom/google/firebase/messaging/FirebaseMessaging; or its super classes (declaration of 'com.google.firebase.messaging.FirebaseMessaging' appears in /data/app/be.robotronic.robonotification-BqRriTOpmAZRJ9pOfdsLUw==/base.apk)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:175)
at anywheresoftware.b4a.BA$2.run(BA.java:365)
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)

Changed following in firebase service :
B4X:
Sub Service_Start (StartingIntent As Intent)
   
   'If fm.HandleIntent(StartingIntent) Then Return
    If StartingIntent.IsInitialized Then fm.HandleIntent(StartingIntent)
    Sleep(0)
    Service.StopAutomaticForeground 'remove if not using B4A v8+.
End Sub

Any ideas?

John
 
Last edited:

jayel

Active Member
Licensed User
Longtime User
Updated firebase sdk to 1.21 and still the same error.
Logger connected to: samsung SM-G960F
--------- beginning of crash
--------- beginning of main
** Receiver (firebasemessaging) OnReceive **
Cannot start from a receiver in debug mode.
** Receiver (firebasemessaging) OnReceive **
Cannot start from a receiver in debug mode.
** Receiver (firebasemessaging) OnReceive **
Cannot start from a receiver in debug mode.
** Receiver (firebasemessaging) OnReceive **
Cannot start from a receiver in debug mode.
** Receiver (firebasemessaging) OnReceive **
Cannot start from a receiver in debug mode.
** Receiver (firebasemessaging) OnReceive **
Cannot start from a receiver in debug mode.
** Receiver (firebasemessaging) OnReceive **
Cannot start from a receiver in debug mode.
** Receiver (firebasemessaging) OnReceive **
Cannot start from a receiver in debug mode.
** Receiver (firebasemessaging) OnReceive **
Cannot start from a receiver in debug mode.
** Receiver (firebasemessaging) OnReceive **
Cannot start from a receiver in debug mode.
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
wissen van data groter dan 30 dagen
** Activity (main) Resume **
*** Service (firebasemessaging) Create ***
** Service (firebasemessaging) Start **
*** Service (httputils2service) Create ***
** Service (httputils2service) Start **
java.lang.NoSuchMethodError: No virtual method subscribeToTopic(Ljava/lang/String;)Lcom/google/android/gms/tasks/Task; in class Lcom/google/firebase/messaging/FirebaseMessaging; or its super classes (declaration of 'com.google.firebase.messaging.FirebaseMessaging' appears in /data/app/be.robotronic.robonotification-pVTkAXCWlTJEVPRQPTk17Q==/base.apk)
at anywheresoftware.b4a.objects.FirebaseNotificationsService$FirebaseMessageWrapper.SubscribeToTopic(FirebaseNotificationsService.java:130)
at be.robotronic.robonotification.firebasemessaging._subscribetotopics(firebasemessaging.java:774)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:735)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:357)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:260)
at java.lang.reflect.Method.invoke(Native Method)

Any help or directions?

John
 
Upvote 0

jayel

Active Member
Licensed User
Longtime User
OK sorry Erel, i wanted to make it shorter....

But B4A sdk manager did seem to solve the problem. Thanks
 
Upvote 0
Top