title: google cloud messaging receiver error
body: <p>When I send a message to my app, I get this message:</p>
  
  <pre><code>    08-12 22:17:12.932: W/GTalkService(475): [DataMsgMgr] broadcast intent callback: result=CANCELLED forIntent { act=com.google.android.c2dm.intent.RECEIVE pkg=com.example.databasetest (has extras) }
      08-12 22:17:12.932: W/GTalkService(475): Receiver package not found, unregister application com.example.databasetest sender 
  </code></pre>
  
  <p>It seems that the message must be sending OK if my app picks up on it trying to receive something. This is my manifest with any sensitive values omitted:</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.example.databasetest"
      android:versionCode="1"
      android:versionName="1.0" &gt;
  
      &lt;uses-permission android:name="android.permission.INTERNET"/&gt;
      &lt;uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /&gt;
      &lt;uses-permission android:name="android.permission.ACCESS_COURSE_LOCATION" /&gt;
      &lt;uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" /&gt;
      &lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /&gt;
      &lt;uses-permission android:name="android.permission.GET_ACCOUNTS" /&gt;
      &lt;uses-permission android:name="android.permission.WAKE_LOCK"/&gt;
  
      &lt;uses-sdk
          android:minSdkVersion="12"
          android:targetSdkVersion="17" /&gt;
      &lt;uses-feature 
          android:glEsVersion="0x00020000"
          android:required="true"/&gt;
      &lt;permission
            android:name="com.example.databasetest.permission.MAPS_RECEIVE"
            android:protectionLevel="signature"/&gt;
      &lt;uses-permission android:name="com.google.android.c2dm.permission.RECEIVE"/&gt;
      &lt;uses-permission android:name="com.example.databasetest.permission.MAPS_RECEIVE" /&gt;
          &lt;permission
            android:name="com.example.databasetest.permission.C2D_MESSAGE"
            android:protectionLevel="signature"/&gt;
      &lt;uses-permission android:name="com.example.databasetest.permission.C2D_MESSAGE" /&gt;
  
      &lt;application
          android:allowBackup="true"
          android:icon="@drawable/ic_launcher"
          android:label="@string/app_name"
          android:theme="@style/AppTheme" &gt;
  
          &lt;meta-data 
              android:name="com.google.android.maps.v2.API_KEY"
              android:value="value"/&gt;
          &lt;activity
              android:name=".Login"
              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;activity android:name=".MainActivity" 
                    android:label="@string/app_name"&gt;
  
          &lt;/activity&gt;
  
          &lt;receiver android:name="com.example.databasetest.GCMreceiver" android:permission="com.google.android.c2dm.permission.SEND"&gt;
            &lt;intent-filter&gt;
               &lt;action android:name="com.google.anroid.c2dm.permission.RECEIVE"/&gt;
               &lt;action android:name="com.google.anroid.c2dm.permission.REGISTRATION"/&gt;
               &lt;category android:name="com.example.databasetest"/&gt; 
  
            &lt;/intent-filter&gt;  
  
          &lt;/receiver&gt;
  
  
      &lt;/application&gt;
  
      &lt;/manifest&gt;
  </code></pre>
  
  <p>And this is the receive method in my file, GCMreceiver.java, which seems to be in the right place. The log is never called. </p>
  
  <pre><code>    @Override
          public void onReceive(Context context, Intent intent)  //receives messages from server
          {
              String action = intent.getAction();
              Log.d("IM", "receive : "+action);
              if(action.equals("com.google.android.c2dm.intent.REGISTRATION"))  //get unique registration id back from server
              {
                  String registrationId = intent.getStringExtra("registration_id");
                  String error = intent.getStringExtra("error");
                  Log.d("IM", "registered: " + registrationId);
                  if(error != null &amp;&amp; !error.isEmpty())
                  {
                      Log.d("IM", "error: " + error);
                  }
  
          }
          else if(action.equals("com.google.android.c2dm.intent.RECEIVE")) //or receive message from server
          {
              Log.d("IM", "im receiving");
              if((connector != null) &amp;&amp; (connector.loc != null) ) //make sure a gps location is available
              {
  
                  String name = intent.getStringExtra("username");
                  String message = intent.getStringExtra("message");
                  double lati = intent.getExtras().getDouble("latitude");
                  double longi = intent.getExtras().getDouble("longitude");
                  messages.add(new Message(name, message, lati, longi));
                  chatAdapter.notifyDataSetChanged();
              }
          }
  
      }
  </code></pre>