title: Not getting device registration id from gcm
body: <p>In my android application, I added notification service for this, I followed <a href="http://developer.android.com/google/gcm/client.html" rel="nofollow">this link</a>.<br>
  It gives this exception:</p>
  
  <blockquote>
    <p>"android.content.pm.PackageManager$NameNotFoundException:"</p>
  </blockquote>
  
  <p>How can I resolve this problem?</p>
  
  <pre><code>manifest.xml
  &lt;uses-sdk android:minSdkVersion="8" android:targetSdkVersion="17"/&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="android.permission.WAKE_LOCK" /&gt;
  &lt;uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" /&gt;
  
  &lt;permission android:name="com.example.gcm.permission.C2D_MESSAGE"
      android:protectionLevel="signature" /&gt;
  &lt;uses-permission android:name="com.example.gcm.permission.C2D_MESSAGE" /&gt;
  
  &lt;application ...&gt;
      &lt;receiver
          android:name=".GcmBroadcastReceiver"
          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;category android:name="com.example.gcm" /&gt;
          &lt;/intent-filter&gt;
      &lt;/receiver&gt;
      &lt;service android:name=".GcmIntentService" /&gt;
  &lt;/application&gt;
  </code></pre>
  
  <p>Error log</p>
  
  <blockquote>
    <p>12-03 12:01:40.868: I/PackageManager(585): Package com.example.gcm
    codePath changed from /data/app/com.example.gcm-2.apk to
    /data/app/com.example.gcm-1.apk; Retaining data and using new 12-03
    12:01:40.878: W/ActivityManager(585): Unable to retrieve gids 12-03
    12:01:40.878: W/ActivityManager(585):
    geandroid.content.pm.PackageManager$NameNotFoundException:
    com.example.gcm 12-03 12:01:40.878: W/ActivityManager(585):   at
    android.app.ApplicationPackageManager.getPackaGids(ApplicationPackageManager.java:143)
    12-03 12:01:40.878: W/ActivityManager(585):   at
    com.android.server.am.ActivityManagerService.startProcessLocked(ActivityManagerService.java:2559)
    12-03 12:01:40.878: W/ActivityManager(585):   at
    com.android.server.am.ActivityManagerService.startProcessLocked(ActivityManagerService.java:2526)
    12-03 12:01:40.878: W/ActivityManager(585):   at
    com.android.server.am.ActivityStackSupervisor.startSpecificActivityLocked(ActivityStackSupervisor.java:1066)
    12-03 12:01:40.878: W/ActivityManager(585):   at
    com.android.server.am.ActivityStack.resumeTopActivityLocked(ActivityStack.java:1633)
    12-03 12:01:40.878: W/ActivityManager(585):   at
    com.android.server.am.ActivityStack.resumeTopActivityLocked(ActivityStack.java:1221)
    12-03 12:01:40.878: W/ActivityManager(585):   at
    com.android.server.am.ActivityStack.finishCurrentActivityLocked(ActivityStack.java:2482)
    12-03 12:01:40.878: W/ActivityManager(585):   at
    com.android.server.am.ActivityStack.finishActivityLocked(ActivityStack.java:2415)
    12-03 12:01:40.878: W/ActivityManager(585):   at
    com.android.server.am.ActivityStack.forceStopPackageLocked(ActivityStack.java:3360)
    12-03 12:01:40.878: W/ActivityManager(585):   at
    com.android.server.am.ActivityStackSupervisor.forceStopPackageLocked(ActivityStackSupervisor.java:1953)
    12-03 12:01:40.878: W/ActivityManager(585):   at
    com.android.server.am.ActivityManagerService.forceStopPackageLocked(ActivityManagerService.java:4507)
    12-03 12:01:40.878: W/ActivityManager(585):   at
    com.android.server.am.ActivityManagerService.access$300(ActivityManagerService.java:203)
    12-03 12:01:40.878: W/ActivityManager(585):   at
    com.android.server.am.ActivityManagerService$2.handleMessage(ActivityManagerService.java:1309)
    12-03 12:01:40.878: W/ActivityManager(585):   at
    com.android.server.am.ActivityManagerService$AThread.run(ActivityManagerService.java:1848)</p>
  </blockquote>