Android Question Problem with Android push notification (GCM)


Active Member
Licensed User

Based on Erel's tuto, I'm trying to run the example code (

I've registered GCM in google API for my project
I've updated SenderId with mine in B4A code.

With the original code, I get this error:
Service Intent must be explicit: Intent { (has extras) }

I've updated sub "RegisterDevice" with Erel's code proposal:

    Dim i As Intent
    If Unregister Then
        i.Initialize("", "")
        i.Initialize("", "")
        i.PutExtra("sender", Main.SenderId)
    End If
    Dim jo As JavaObject = i
    jo.RunMethod("setPackage", Array(""))
    Dim r As Reflector
    Dim i2 As Intent
    i2 = r.CreateObject("android.content.Intent")
    Dim pi As Object
    pi = r.RunStaticMethod("", "getBroadcast", _
     Array As Object(r.GetContext, 0, i2, 0), _
     Array As String("android.content.Context", "", "android.content.Intent", ""))
    i.PutExtra("app", pi)

and the error became "Not found" on jobdone result.

I ran both code on emulator and real device.

I really don't know what to do ...
Any idea ?


Well-Known Member
Licensed User
Upvote 0


Active Member
Licensed User
Hi BillMeyer,

I did as you said.

While running my app, I get an error about manifest and don't understand why ....
Here is my manifest:

'This code will be applied to the manifest file during compilation.
'You do not need to modify it in most cases.
'See this link for for more information:
<uses-sdk android:minSdkVersion="5" android:targetSdkVersion="26"/>
<supports-screens android:largeScreens="true"
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
CreateResourceFromFile(Macro, Themes.DarkTheme)

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

At the end of compilation, I've got this 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]

I've just added the 3 last lines.
Last edited:
Upvote 0


Active Member
Licensed User
after some tests, the involved line generated this error is
CreateResourceFromFile(Macro, FirebaseAnalytics.Firebase)

If I remove this line from the manifest, no error on compilation. Just an error on service start.
Upvote 0


Active Member
Licensed User
In fact, it was due to 2 different problems:
- library were not up to date
- effectively, package name was in upper case.
Both corrected and it works.
Upvote 0