I get java.lang.NoSuchMethodError: com.google.firebase.messaging.FirebaseMessaging.subscribeToTopic in new release.
I updated absolutelly all - Java 64-bit, Android Studio (all SDK platforms and tools are installed), SDK Manager in B4A.
Nothing helps. Meanwhile FirebaseMessaging.jar from 8.0 works fine.
What is interesting, java code in both jar files is 100% the same.
I made simple sample. To run it, it's necessary to change project name and to copy google-services.json
Error in 8.30, but works fine, if to copy FilebaseMessaging.jar from B4A 8.00
Changed the path shown in this process by updating your SDK from the B4A menu for the new SDK?
I have read in some forums that one should not test in the Android Emulator. I also read that your device must have an updated version of Google Play Services.
I get java.lang.NoSuchMethodError: com.google.firebase.messaging.FirebaseMessaging.subscribeToTopic in new release.
I updated absolutelly all - Java 64-bit, Android Studio (all SDK platforms and tools are installed), SDK Manager in B4A.
Nothing helps. Meanwhile FirebaseMessaging.jar from 8.0 works fine.
What is interesting, java code in both jar files is 100% the same.
Make sure that all recommended items are up to date in B4A Sdk Manager. Based on the partially posted error message you are using an old version of firebase-messaging resource.
I don't understand, how "an old version of firebase-messaging resource" appears.
I completely uninstall Java, Android Studio, SDK Tools, B4A. Then manully searched corressponding folders and removed them.
And after this only I install all again. Distributives are current (I download from Web-site).
Of course, this is no garantee that I found all. What to check in registry / folders ?
Complete log:
B4X:
firebasemessaging_subscribetotopics (java line: 148)
java.lang.NoSuchMethodError: com.google.firebase.messaging.FirebaseMessaging.subscribeToTopic
at anywheresoftware.b4a.objects.FirebaseNotificationsService$FirebaseMessageWrapper.SubscribeToTopic(FirebaseNotificationsService.java:130)
at com.quick.men.firebasemessaging._subscribetotopics(firebasemessaging.java:148)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:191)
at anywheresoftware.b4a.keywords.Common$11.run(Common.java:1154)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:157)
at android.app.ActivityThread.main(ActivityThread.java:5356)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1265)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1081)
at dalvik.system.NativeStart.main(Native Method)
You don't need Android Studio at all. Follow the installation instructions: https://www.b4x.com/b4a.html
Also make sure that you don't have an old version of FirebaseNotifications.jar in the internal libraries folder.
If you are not sure then reinstall B4A in a new folder.
Due to your remark "You don't need Android Studio at all" I understood a reason of troubles.
I set "android.jar" path according comment "usually found under C:\Android-sdk\platforms\android-x". Like I understand, B4a refers to SDK folder in Android Studio.
By unknown reasons Android Studio installs firebase-messaging mavens from 9.0.0 to 11.0.4 only. Release 17.0.0 is not present.
So, I changed android.jar path to B4A SDK Manager folder.
Now works. Thanx