Android Question Firebase Messaging Issue with v8.30 SubscribeToTopic and FirebaseNotification 1.21

Alberto Iglesias

Well-Known Member
Licensed User
Longtime User
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)


Screen_Shot_08-11-18_at_02.02_PM.png


Screen_Shot_08-11-18_at_02.03_PM.png


Screen_Shot_08-11-18_at_02.04_PM.png
 
Last edited:

Alberto Iglesias

Well-Known Member
Licensed User
Longtime User
Hello Manfred,

I follow step by step, reinstall everything, download android SDK, Java, last firebase notifications (1.21) library, last firebase Analytics (1.2), manifest checked.

I created a minimum sample, but still with the sample error.

Can you check this sample attached here? Please?!

Thank you soo much
 

Attachments

  • MinimumSample.zip
    10.5 KB · Views: 252
Upvote 0

ivan.tellez

Active Member
Licensed User
Longtime User
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.
 
Upvote 0

Semen Matusovskiy

Well-Known Member
Licensed User
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.
 
Last edited:
Upvote 0

Alberto Iglesias

Well-Known Member
Licensed User
Longtime User
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

How is the simple way to fix this?
 
Upvote 0

Semen Matusovskiy

Well-Known Member
Licensed User
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.

3) Uninstall all Java releases.

4) Open http://www.oracle.com/technetwork/java/javase/downloads/jdk10-downloads-4416644.html , download and install jdk-10.0.2_windows-x64_bin.exe

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).
 
Upvote 0
Top