Intent Service Extras not found upon Receiving a message

1,847 views
Skip to first unread message

Marc Davies

unread,
Jul 19, 2013, 6:25:20 AM7/19/13
to andro...@googlegroups.com
Hi i have a problem i cannot seem to fix. Currently i have an app that uses the GCM to receive notifications from a third party HTTP server and all my tests so far reveal that my registration to both the GCM and my server work fine and communication is going between the two of them. My problem is when ever i send a notification from my server (which is currently hosted in a live environment) my receiver gets pinged but nothing is ever shown and i receive this report on my LogCat.

07-19 11:13:37.475: W/ActivityManager(148): Unable to start service Intent { act=com.google.android.c2dm.intent.RECEIVE cat=[koodoo.pushtest] flg=0x10 cmp=koodoo.pushtest/.GCMIntentService (has extras) }: not found

I am currently using using the Code on the Google step by step guide as well as a bit of my own code to register to the HTTP server. Any help with this would be much appreciated thanks.

Bandari Ganesh

unread,
Jul 19, 2013, 7:02:07 AM7/19/13
to andro...@googlegroups.com

Check the Manifest. Make sure u have declared the custom permission so only your app can receive its messages. To include custom permission do the following:

         <permission
        android:name="<Your Package name>.permission.C2D_MESSAGE"
        android:protectionLevel="signature" />

 And make sure you have declared the intent filters correctly for receiver declaration in Manifest. Sample Receiver declaration in Manifest.

      <receiver
            android:name=".GcmBroadcastReceiver"
            android:permission="com.google.android.c2dm.permission.SEND" >
            <intent-filter>

                <!-- Receives the actual messages. -->
                <action android:name="com.google.android.c2dm.intent.RECEIVE" />
                <action android:name="com.google.android.c2dm.intent.REGISTRATION" />
                <category android:name="
<Your Package name>" />
            </intent-filter>
        </receiver>


 
 

Marc Davies

unread,
Jul 19, 2013, 7:09:45 AM7/19/13
to andro...@googlegroups.com
thanks for your speedy reply when i make the changes you suggest I get an error saying that it could not instantiate the receiver.

here is my Manifest as it was before the change:

<?xml version="1.0" encoding="utf-8"?>

<manifest xmlns:android="http://schemas.android.com/apk/res/android"

    package="koodoo.pushtest"

    android:versionCode="1"

    android:versionName="1.0" >

    <uses-sdk

        android:minSdkVersion="8"

        android:targetSdkVersion="17" />

    <uses-permission android:name="android.permission.INTERNET" />

    <uses-permission android:name="android.permission.GET_ACCOUNTS" />

    <uses-permission android:name="android.permission.WAKE_LOCK" />

    <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />

    

    <permission android:name="koodoo.pushtest.permission.C2D_MESSAGE" 

        android:protectionLevel="signature" />

    <uses-permission android:name="koodoo.pushtest.permission.C2D_MESSAGE" />


    <application

        android:allowBackup="true"

        android:icon="@drawable/ic_launcher"

        android:label="@string/app_name"

        android:theme="@style/AppTheme" >

        <activity

            android:name="koodoo.pushtest.MainActivity"

            android:label="@string/app_name" >

            <intent-filter>

                <action android:name="android.intent.action.MAIN" />


                <category android:name="android.intent.category.LAUNCHER" />

            </intent-filter>

        </activity>

        

         <receiver

            android:name="com.google.android.gcm.GCMBroadcastReceiver"

            android:permission="com.google.android.c2dm.permission.SEND" >

            <intent-filter>

                <action android:name="com.google.android.c2dm.intent.RECEIVE" />

                <category android:name="koodoo.pushtest" />

            </intent-filter>

        </receiver>

         <!-- <service android:name="koodoo.pushtest.GCMIntentService" /> -->

        <service android:name="com.google.android.gcm.GCMIntentService" android:enabled="true" /> 

    </application>


</manifest>

Bandari Ganesh

unread,
Jul 19, 2013, 8:16:34 AM7/19/13
to andro...@googlegroups.com

       Change the Receiver name  from android:name="com.google.android.gcm.GCMBroadcastReceiver" 

           

       to    android:name="koodoo.pushtest.GCMBroadcastReceiver"

      


         


Marc Davies

unread,
Jul 22, 2013, 4:12:13 AM7/22/13
to andro...@googlegroups.com
Hi sorry for the delayed reply Im not in the office over the weekend so had no access to my project. I did as you said but also moved my broadcast receiver into a separate file and that fixed the problem. I originally had the receiver within the Main Activity class which was giving me the error. Thanks for the help it was greatly appreciated.

vikas...@playbuff.com

unread,
Jul 14, 2017, 1:58:46 AM7/14/17
to android-gcm
Doing all these changes, I m still getting the same error.
Unable to launch app com.myApp.xxx/10379 for broadcast Intent { act=com.google.android.c2dm.intent.RECEIVE flg=0x10 pkg=com.myApp.xxx (has extras) }: process is bad
broadcast intent callback: result=CANCELLED forIntent { act=com.google.android.c2dm.intent.RECEIVE pkg=com.myApp.xxx (has extras) }

Todd Hansen

unread,
Jul 31, 2017, 5:37:35 PM7/31/17
to andro...@googlegroups.com
Is the device you are testing with using an OEM specific auto start white list (for example: http://en.miui.com/thread-117992-1-1.html)? If so, you need to ensure your app is in that white list.

Alternatively, if the app was previously force closed by the user the app can't be started to receive messages until the user manually opens the app.

--
You received this message because you are subscribed to the Google Groups "android-gcm" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-gcm+unsubscribe@googlegroups.com.
To post to this group, send email to andro...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-gcm/c657c4ee-ae99-45a2-9293-03b0b75ea013%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages