I still having problems in Firebase Messaging with B4A 8.30 and Library 1.21
Somebody know how to fix this? have some update to FirebaseNotification Library?
B4X:
Logger connected to: db27d4e9
--------- beginning of system
--------- beginning of main
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
*** Service (firebasemessaging) Create ***
** Service (firebasemessaging) Start **
firebasemessaging_subscribetotopics (java line: 233)
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/com.visualnet.geracao-1/base.apk)
at anywheresoftware.b4a.objects.FirebaseNotificationsService$FirebaseMessageWrapper.SubscribeToTopic(FirebaseNotificationsService.java:130)
at com.visualnet.geracao.firebasemessaging._subscribetotopics(firebasemessaging.java:233)
at java.lang.reflect.Method.invoke(Native Method)
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:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6126)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
Maybe is a Bug on the SDK Manager. Last week I install a new pc, I got the same error, and the same, install Android Studio, installing only SDK, reinstalling SDK from B4A SDK manager.
Nothing worked. As i didnt have time to investigate, I just copy the SDK folder of the old pc and firebase just worked.
B4A library uses more modern Mavens than Android Studio installs. Check Tools - Paths in B4A IDE.
android.jar must refer to B4A SDK folder, not to Android SDK folder.
Unlike android.jar are the same in both folders, B4A uses parameter "android.jar path" to understand, from which folder to take mavens and etc.
OK @Erel, I already put the text of the error in first post.
Now I tried one thing more:
I have 2 machines with B4A, one with 8.0.0 and another one with 8.3.0 and I get the libraries from 8.0.0 (FirebaseAuth and FirebaseNotifications) and put in the libraries into 8.3.0.
Now is working, but I'm working with the version FireNotification v1.1 and FirebaseAuth v1.0.2
To mix releases is incorrect way. Do following (the description assumes Windows 10 x64 on drive C)
1) If Android Studio is installed, run it. Tools -> SDK manager. Look Android SDK path. It will be something like C:\Users\Alberto\AppData\Local\Android\Sdk.
Uninstall Android Studio (actually you don't need at all) and remove Android SDK folder.
2) Uninstall all releases of B4A and remove folders, which you created for SDK tools.
5) Create new folder, let's say, C:\B4A_SDK. Install B4A 8.30 and run it. Set javac.exe path (C:\Program Files\Java\jdk-10.0.2\bin\javac.exe).
6) Run SDK manager. Click "Download SDK". Download sdk-tools-windows-4333796 and extract subfolder tools to C:\B4A_SDK. Set sdkmanager.bat path (C:\B4A_SDK\tools\bin\sdkmanager.bat) and install "all recommended". Then set android.jar path in Configurate Paths (C:\B4A_SDK\platforms\android-27\android.jar).
Based on the error message you are not using the latest version of firebase-messaging. Make sure that the path to android.jar actually points to the SDK managed with B4A Sdk Manager.