Go again over the tutorial and do it the right way
https://www.b4x.com/android/forum/threads/integrating-firebase-services.67692/
I just tried a project of mine and used an updated sdk. It does work here as expected.
Hello,
let me try to be clear:
1. I have an apk published and 100% functional running on Google Play Store, compiled with Firebase and B4A V7 ...
2. I upgraded to B4A V8... then, added to the Manifest, as oriented in tutorial:
CreateResourceFromFile(Macro, FirebaseAnalytics.GooglePlayBase)
CreateResourceFromFile(Macro, FirebaseAnalytics.Firebase)
CreateResourceFromFile(Macro, FirebaseNotifications.FirebaseNotifications)
3. The line above and json was already referenced in V7 at the same way:
CreateResourceFromFile("google-services", "google-services.json")
4. Compiled fine with B4A V8, but when running:
Initialize_Voip
** Activity (main) Pause, UserClosed = true **
*** Service (firebasemessaging) Create ***
** Service (firebasemessaging) Start **
** Service (firebasemessaging) Start **
** Service (firebasemessaging) Start **
** Activity (dialpad) Create, isFirst = true **
** Activity (dialpad) Resume **
java.lang.NoSuchMethodError: No virtual method subscribeToTopic(Ljava/lang/String
V in class Lcom/google/firebase/messaging/FirebaseMessaging; or its super classes (declaration of 'com.google.firebase.messaging.FirebaseMessaging' appears in /mnt/asec/com.comten.nexphone-45/base.apk)
at anywheresoftware.b4a.objects.FirebaseNotificationsService$FirebaseMessageWrapper.SubscribeToTopic(FirebaseNotificationsService.java:130)
at com.comten.nexphone.firebasemessaging._subscribeindividual(firebasemessaging.java:1527)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
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 java.lang.reflect.Method.invoke(Method.java:372)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:139)
at anywheresoftware.b4a.BA$2.run(BA.java:360)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:6939)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199)
java.lang.RuntimeException: java.lang.NoSuchMethodError: No virtual method subscribeToTopic(Ljava/lang/String
V in class Lcom/google/firebase/messaging/FirebaseMessaging; or its super classes (declaration of 'com.google.firebase.messaging.FirebaseMessaging' appears in /mnt/asec/com.comten.nexphone-45/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:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:6939)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199)
Caused by: java.lang.NoSuchMethodError: No virtual method subscribeToTopic(Ljava/lang/String
V in class Lcom/google/firebase/messaging/FirebaseMessaging; or its super classes (declaration of 'com.google.firebase.messaging.FirebaseMessaging' appears in /mnt/asec/com.comten.nexphone-45/base.apk)
at anywheresoftware.b4a.objects.FirebaseNotificationsService$FirebaseMessageWrapper.SubscribeToTopic(FirebaseNotificationsService.java:130)
at com.comten.nexphone.firebasemessaging._subscribeindividual(firebasemessaging.java:1527)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:710)
This is the problem... whats is wrong?