Android Question FirebaseNotifications & manifest error

Yayou49

Active Member
Licensed User
Hi,

I did implement the firebase notification in my project, as describe in thread https://www.b4x.com/android/forum/t...-messages-firebase-cloud-messaging-fcm.67716/.
As requested, I've added 3 new lines in my manifest:

B4X:
CreateResourceFromFile(Macro, FirebaseAnalytics.Firebase)
CreateResourceFromFile(Macro, FirebaseAnalytics.GooglePlayBase)
CreateResourceFromFile(Macro, FirebaseNotifications.FirebaseNotifications)

While compiling, at the end, I'm facing an error:
Installation sur le dispositif. Error
adb: failed to install xxxx.apk: Failure [INSTALL_PARSE_FAILED_MANIFEST_MALFORMED: Failed parse during installPackageLI: /data/app/vmdl1131351572.tmp/base.apk (at Binary XML file line #14): Bad class name xxxx.V1.permission.C2D_MESSAGE in package xxxx.V1]

If I check in manifest.xml line 14, I've got:
<permission android:name="xxxx.V1.permission.C2D_MESSAGE"
android:protectionLevel="signature" />

Does someone know what about this error ?
 

DonManfred

Expert
Licensed User
Longtime User
I check this token on my side ?
You need to setup a Admin Version. It can not be sone with B4A. This is my last answer as you should have created a new thread for any new question you have.
 
Upvote 0

Yayou49

Active Member
Licensed User
Far away from me to ask you to teach me something !! don't be afraid :)
So far your big help and attention is enough for me.

BTW, I'm far to start to push a notification while starting the first service is not working ....
 
Upvote 0

Yayou49

Active Member
Licensed User
no, I still have error:
firebasemessaging_subscribetotopics (java line: 228)
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/yaya.yld-2/base.apk)
at anywheresoftware.b4a.objects.FirebaseNotificationsService$FirebaseMessageWrapper.SubscribeToTopic(FirebaseNotificationsService.java:130)
at yaya.yld.firebasemessaging._subscribetotopics(firebasemessaging.java:228)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:186)
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:6077)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:756)

With exactly the same code as I have uploaded on the forum.
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Upvote 0

Yayou49

Active Member
Licensed User
YOU WIN !!!!!!
My little project is now working !

Many Thanks Don Manfred for your patience and insight ;)
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
YOU WIN !!!!!!
My little project is now working !

Many Thanks Don Manfred for your patience and insight ;)
Ok. You now know it is working.
Going back to your old project you now need to rebuild the Manifest to get the malformed manifest fixed.

Start with the Manifest from your new Project here.
Check what else is missing for your "old app". Adding permissions...
 
Upvote 0

Yayou49

Active Member
Licensed User
Reading some other forums, it seems package name with upper case can be a problem for Firebase.
I will check this point and close this thread with my final situation.
 
Upvote 0

Yayou49

Active Member
Licensed User
Well I confirm that package name with upper case make Firebase stuff crashing.
I've updated my package name to lower case and update my Firebase project and everything goes well !!

This thread can now be close.

Thanks again !!!
 
Upvote 0
Top