Android Question Error Firebase with B4A V8

Marcos Alves

Well-Known Member
Licensed User
Longtime User
Hi,

I'm trying to compile an apk using B4A V8 and got the error:

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 /data/app/com.comten.nexphone-2/base.apk)

The compilation was running without any error in B4A V7... what's wrong?

Like recommended, I added the lines to Manifest:

CreateResourceFromFile(Macro, FirebaseAnalytics.GooglePlayBase)
CreateResourceFromFile(Macro, FirebaseAnalytics.Firebase)
CreateResourceFromFile(Macro, FirebaseNotifications.FirebaseNotifications)
CreateResourceFromFile("google-services", "google-services.json")

Doesn't work either :( . I'm seriously thinking to do a downgrade to B4A 7...
 
Last edited:

Marcos Alves

Well-Known Member
Licensed User
Longtime User
Hi @Erel ... thanks for answering. I'm sure that in V8 I'll do much more. Now it's clear: the Firebase library old version has a compatibility issue with new Android SDK. My suggestion: in the thread https://www.b4x.com/android/forum/threads/b4a-v8-0-has-been-released.90828/#content - add explicit comment that it's needed to update the Firebase, with the link to download the new version. I recommend this because many community members - including me - are using an old version of sdk and installing V8 we upgrade this as a step of the process - so, it's easy don't realize that the problem is related to sdk version . By the way, thanks for fast and efficient job as always - your support makes B4X the best framework to use in the world!
 
Upvote 0

Marcos Alves

Well-Known Member
Licensed User
Longtime User
This error has nothing to do with B4A v8 vs B4A v7. Google has changed an API and the library required an update to work properly: https://www.b4x.com/android/forum/threads/updates-to-internal-libraries.59340/#post-591400


The only reason that it worked when you test it with B4A v7 is that you used an old version of the Android SDK. You could have done the exact same thing with B4A v8.
There is nothing in B4A v7 that is not supported in v8.
Update... considering the Google Sdk 26 deadline (November = panic ! :eek:) , I finally did the upgrade and worked in V8! Thanks @Erel
 
Upvote 0
Top