Hi
I have upgraded one of my development machines to B4A v8.0
I am now havng problems running an app which uses firebase Messaging
NOTE: this code works fine on another machine running v7.8
TargetSDKVersion is 23 (I'm working my way up to 26 !)
The error I have is :
java.lang.NoSuchMethodError: No virtual method subscribeToTopic(Ljava/lang/StringV in class Lcom/google/firebase/messaging/FirebaseMessaging; or its super classes (declaration of 'com.google.firebase.messaging.FirebaseMessaging'
The code in Firebase Messaging is:
and I have upgraded the manifest file to use the Macro snippets.
I have also upgraded the FirebaseAnalytics library to 1.01.
Any Ideas?
I have upgraded one of my development machines to B4A v8.0
I am now havng problems running an app which uses firebase Messaging
NOTE: this code works fine on another machine running v7.8
TargetSDKVersion is 23 (I'm working my way up to 26 !)
The error I have is :
java.lang.NoSuchMethodError: No virtual method subscribeToTopic(Ljava/lang/StringV in class Lcom/google/firebase/messaging/FirebaseMessaging; or its super classes (declaration of 'com.google.firebase.messaging.FirebaseMessaging'
Logger connected to: HUAWEI PLK-L01
--------- beginning of main
Copying updated assets files (1)
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
autoversion: 685.0
compilation time: 25 May 2018 14:03:51
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
*** Service (imagedownloader) Create ***
** Service (imagedownloader) Start **
*** Service (phonestatus) Create ***
** Service (phonestatus) Start **
*** Service (firebasemessaging) Create ***
** Service (firebasemessaging) Start **
*** Service (syncgame) Create ***
** Service (syncgame) Start **
** Service (firebasemessaging) Start **
java.lang.NoSuchMethodError: No virtual method subscribeToTopic(Ljava/lang/StringV in class Lcom/google/firebase/messaging/FirebaseMessaging; or its super classes (declaration of 'com.google.firebase.messaging.FirebaseMessaging' appears in /mnt/asec/com.cluedupp.cluedupp2-2/base.apk)
at anywheresoftware.b4a.objects.FirebaseNotificationsService$FirebaseMessageWrapper.SubscribeToTopic(FirebaseNotificationsService.java:130)
at com.cluedupp.cluedupp2.firebasemessaging._subscribetopic(firebasemessaging.java:461)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:710)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:339)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:249)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:139)
at anywheresoftware.b4a.BA$2.run(BA.java:360)
at android.os.Handler.handleCallback(Handler.java:743)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:150)
at android.app.ActivityThread.main(ActivityThread.java:5546)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:794)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:684)
java.lang.RuntimeException: java.lang.NoSuchMethodError: No virtual method subscribeToTopic(Ljava/lang/StringV in class Lcom/google/firebase/messaging/FirebaseMessaging; or its super classes (declaration of 'com.google.firebase.messaging.FirebaseMessaging' appears in /mnt/asec/com.cluedupp.cluedupp2-2/base.apk)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:170)
at anywheresoftware.b4a.BA$2.run(BA.java:360)
at android.os.Handler.handleCallback(Handler.java:743)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:150)
at android.app.ActivityThread.main(ActivityThread.java:5546)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:794)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:684)
Caused by: java.lang.NoSuchMethodError: No virtual method subscribeToTopic(Ljava/lang/StringV in class Lcom/google/firebase/messaging/FirebaseMessaging; or its super classes (declaration of 'com.google.firebase.messaging.FirebaseMessaging' appears in /mnt/asec/com.cluedupp.cluedupp2-2/base.apk)
at anywheresoftware.b4a.objects.FirebaseNotificationsService$FirebaseMessageWrapper.SubscribeToTopic(FirebaseNotificationsService.java:130)
at com.cluedupp.cluedupp2.firebasemessaging._subscribetopic(firebasemessaging.java:461)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:710)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:339)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:249)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:139)
... 8 more
--------- beginning of main
Copying updated assets files (1)
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
autoversion: 685.0
compilation time: 25 May 2018 14:03:51
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
*** Service (imagedownloader) Create ***
** Service (imagedownloader) Start **
*** Service (phonestatus) Create ***
** Service (phonestatus) Start **
*** Service (firebasemessaging) Create ***
** Service (firebasemessaging) Start **
*** Service (syncgame) Create ***
** Service (syncgame) Start **
** Service (firebasemessaging) Start **
java.lang.NoSuchMethodError: No virtual method subscribeToTopic(Ljava/lang/StringV in class Lcom/google/firebase/messaging/FirebaseMessaging; or its super classes (declaration of 'com.google.firebase.messaging.FirebaseMessaging' appears in /mnt/asec/com.cluedupp.cluedupp2-2/base.apk)
at anywheresoftware.b4a.objects.FirebaseNotificationsService$FirebaseMessageWrapper.SubscribeToTopic(FirebaseNotificationsService.java:130)
at com.cluedupp.cluedupp2.firebasemessaging._subscribetopic(firebasemessaging.java:461)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:710)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:339)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:249)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:139)
at anywheresoftware.b4a.BA$2.run(BA.java:360)
at android.os.Handler.handleCallback(Handler.java:743)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:150)
at android.app.ActivityThread.main(ActivityThread.java:5546)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:794)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:684)
java.lang.RuntimeException: java.lang.NoSuchMethodError: No virtual method subscribeToTopic(Ljava/lang/StringV in class Lcom/google/firebase/messaging/FirebaseMessaging; or its super classes (declaration of 'com.google.firebase.messaging.FirebaseMessaging' appears in /mnt/asec/com.cluedupp.cluedupp2-2/base.apk)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:170)
at anywheresoftware.b4a.BA$2.run(BA.java:360)
at android.os.Handler.handleCallback(Handler.java:743)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:150)
at android.app.ActivityThread.main(ActivityThread.java:5546)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:794)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:684)
Caused by: java.lang.NoSuchMethodError: No virtual method subscribeToTopic(Ljava/lang/StringV in class Lcom/google/firebase/messaging/FirebaseMessaging; or its super classes (declaration of 'com.google.firebase.messaging.FirebaseMessaging' appears in /mnt/asec/com.cluedupp.cluedupp2-2/base.apk)
at anywheresoftware.b4a.objects.FirebaseNotificationsService$FirebaseMessageWrapper.SubscribeToTopic(FirebaseNotificationsService.java:130)
at com.cluedupp.cluedupp2.firebasemessaging._subscribetopic(firebasemessaging.java:461)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:710)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:339)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:249)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:139)
... 8 more
The code in Firebase Messaging is:
B4X:
Public Sub SubscribeTopic(topicName As String)
Private strg As String = MiscCode.ConvertNametoTopic(topicName) ' Replaces invalid characters with underscore
fm.SubscribeToTopic(strg) ' Error occurs here
Log("Subscribing to " & strg)
topics.Add(strg)
End Sub
and I have upgraded the manifest file to use the Macro snippets.
I have also upgraded the FirebaseAnalytics library to 1.01.
Any Ideas?