Reputation: 28509
My app receives an intent from the C2DM servers to register for push notifications (which works fine), and on receiving that message through a broadcast receiver it starts an IntentService (to handle the intent received from C2DM). However the call to start that IntentService is failing with this:
Unable to start service Intent { act=com.google.android.c2dm.intent.REGISTRATION
cat=[com.company.myapp] cmp=com.company.myapp/.receiver.C2DMReceiver
(has extras) }: not found
Can you help me understand what this error means? The C2DMReceiver class is subclassed from IntentService, and it certainly exists. I am using Intent.setClass() and specifying the class directly. The compiler accepts it, so I do not understand why the exception is saying "Not found". What is not found?
If anyone can offer any tips on debugging this, I'd really appreciate it.
<receiver android:name="com.company.myapp.receiver.C2DMBroadcastReceiver" android:permission="com.google.android.c2dm.permission.SEND">
<!-- Receive the actual message -->
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<category android:name="com.company.myapp" />
</intent-filter>
<!-- Receive the registration id -->
<intent-filter>
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="com.company.myapp" />
</intent-filter>
</receiver>
Upvotes: 1
Views: 6797
Reputation: 28509
The cause of this was the tag was missing from the manifest. Unfortunately it looks like I accidentally deleted it from the manifest, probably whilst making another edit. With the manifest entry there, the IntentService starts fine.
Upvotes: 1
Reputation: 80330
You must have a device with android 2.2+ and Market app installed (meaning it's an official Google device).
Upvotes: 0
Reputation: 2922
Have you registered an Intent filter with action com.google.android.c2dm.intent.REGISTRATION
in your AndroidManifest.xml?
Upvotes: 0