title: Unable to start service Intent { act=com.google.android.c2dm.intent.REGISTRATION (has extras) } U=0: not found
body: <p>I am trying to get the registration id of a device (testing using the emulator) to set up push notifications using GCM.</p>
  
  <p>I have tried the following code, which gives me the following error: </p>
  
  <pre><code> Unable to start service Intent { act=com.google.android.c2dm.intent.REGISTRATION (has extras) } U=0: not found
  </code></pre>
  
  <p>Manifest file</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.me.pushnotifications"
      android:versionCode="1"
      android:versionName="1.0" &gt;
      &lt;uses-permission android:name="android.permission.INTERNET"/&gt;
      &lt;uses-permission android:name="android.permission.GET_ACCOUNTS"/&gt;
      &lt;uses-permission android:name="com.google.android.c2dm.permission.RECEIVE"/&gt;
  
      &lt;permission android:name="com.me.pushnotifications.permission.C2D_MESSAGE" android:protectionLevel="signature" /&gt;
      &lt;uses-permission android:name="com.me.pushnotifications.permission.C2D_MESSAGE"  /&gt;
  
  
      &lt;uses-sdk
          android:minSdkVersion="10"
          android:targetSdkVersion="18" /&gt;
  
      &lt;application
          android:allowBackup="true"
          android:icon="@drawable/ic_launcher"
          android:label="@string/app_name"
          android:theme="@style/AppTheme" &gt;
  
          &lt;receiver android:name="com.me.pushnotifications.MyBroadcastReceiver"
          android:permission="com.google.android.c2dm.permission.SEND"&gt;
          &lt;intent-filter&gt;
              &lt;action android:name="com.google.android.c2dm.intent.RECEIVE"/&gt;
              &lt;action android:name="com.google.android.c2dm.intent.REGISTRATION"/&gt;
              &lt;category android:name="com.me.pushnotifications"/&gt;
          &lt;/intent-filter&gt;
  
          &lt;/receiver&gt;
  
  
          &lt;activity
              android:name="com.me.pushnotifications.MainActivity"
              android:label="@string/app_name" &gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="android.intent.action.MAIN" /&gt;
  
                  &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
              &lt;/intent-filter&gt;
          &lt;/activity&gt;
      &lt;/application&gt;
  
  &lt;/manifest&gt;
  </code></pre>
  
  <p>I am using a BroadcastReceiver to achieve the purpose:</p>
  
  <pre><code>package com.me.pushnotifications;
  
  import android.content.BroadcastReceiver;
  import android.content.Context;
  import android.content.Intent;
  import android.util.Log;
  
  public class MyBroadcastReceiver extends BroadcastReceiver{
  
      @Override
      public void onReceive(Context arg0, Intent intent) {
          // TODO Auto-generated method stub
          String action = intent.getAction();
          Log.i("action::",action);
          try{
              if(action.equals("com.google.android.c2dm.intent.REGISTRATION")){
                  String regId = intent.getStringExtra("registration_id");
                  String error = intent.getStringExtra("error");
                  String unregistered = intent.getStringExtra("unregistered");
                  Log.i("regId::",regId);
              }
              else if(action.equals("com.google.android.c2dm.intent.RECEIVE")){
                  String data = intent.getStringExtra("data");
                  Log.i("data::",data);
              }
          }
          finally{
  
          }
      }
  
  }
  </code></pre>
  
  <p>MainActivity</p>
  
  <pre><code>package com.me.pushnotifications;
  
  import android.app.Activity;
  import android.app.PendingIntent;
  import android.content.Context;
  import android.content.Intent;
  import android.os.Bundle;
  import android.util.Log;
  import android.view.Menu;
  import android.view.View;
  import android.view.View.OnClickListener;
  import android.widget.Button;
  
  public class MainActivity extends Activity {
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
          final Context context = getApplicationContext();
  
          final String appId = getResources().getString(R.string.appId) ;
          Log.i("appName::",appId);
          Button activateButton,deactivateButton;
          activateButton = (Button)findViewById(R.id.activateButton);
          deactivateButton = (Button)findViewById(R.id.deactivateButton);
  
          activateButton.setOnClickListener(new OnClickListener() {
  
              @Override
              public void onClick(View v) {
                  // TODO Auto-generated method stub
                  Log.i("activate::","clicked");
                  Intent regIntent = new Intent("com.google.android.c2dm.intent.REGISTRATION");
                  Log.i("intent::","created");
                  regIntent.putExtra("app", PendingIntent.getBroadcast(context, 0,
                          new Intent(), 0));
  regIntent.putExtra("sender", "registration_id");
                  startService(regIntent);
              }
          });
  
          deactivateButton.setOnClickListener(new OnClickListener() {
  
              @Override
              public void onClick(View v) {
                  // TODO Auto-generated method stub
                  Log.i("deactivate::","clicked");
                  Intent unregIntent = new Intent("com.google.android.c2dm.intent.UNREGISTER");
                  Log.i("intent::","created");
                  unregIntent.putExtra("app", PendingIntent.getBroadcast(context, 0,
                          new Intent(), 0));
                  startService(unregIntent);
              }
          });
      }
  
  
      @Override
      public boolean onCreateOptionsMenu(Menu menu) {
          // Inflate the menu; this adds items to the action bar if it is present.
          getMenuInflater().inflate(R.menu.main, menu);
          return true;
      }
  
  }
  </code></pre>
  
  <p>I have installed the Google API's for API Level 18. What may be the reason for the issue?</p>