title: New GCM API Register Unknown Source Error
body: <p>I am currently building an application that uses the new Google Cloud Messaging system. I have a HTTP client server set up on a live environment to allow me to test through my mobile devices, but when ever I try to register with the GCM I keep getting a IOException that states that <code>gcm.register()</code> is receiving an Unknown Source stopping me from getting the Registration Id I need to allow my server send messages to my device.</p>
  <p>I have checked several times to see if my Sender Id is wrong and I have checked over my manifest as well to see if I have that wrong as well and I cannot seem to find the problem. Looking around also hasn't provided any answer to my problem.</p>
  <p>Here is my Log:</p>
  <pre><code>07-18 11:34:25.487: W/System.err(3093): java.io.IOException: MAIN_THREAD
  07-18 11:34:25.497: W/System.err(3093):     at com.google.android.gms.gcm.GoogleCloudMessaging.register(Unknown Source)
  07-18 11:34:25.497: W/System.err(3093):     at koodoo.pushtest.MainActivity.onCreate(MainActivity.java:94)
  07-18 11:34:25.497: W/System.err(3093):     at android.app.Activity.performCreate(Activity.java:4492)
  07-18 11:34:25.497: W/System.err(3093):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
  07-18 11:34:25.497: W/System.err(3093):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920)
  07-18 11:34:25.497: W/System.err(3093):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
  07-18 11:34:25.497: W/System.err(3093):     at android.app.ActivityThread.access$600(ActivityThread.java:123)
  07-18 11:34:25.497: W/System.err(3093):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
  07-18 11:34:25.497: W/System.err(3093):     at android.os.Handler.dispatchMessage(Handler.java:99)
  07-18 11:34:25.497: W/System.err(3093):     at android.os.Looper.loop(Looper.java:137)
  07-18 11:34:25.497: W/System.err(3093):     at android.app.ActivityThread.main(ActivityThread.java:4424)
  07-18 11:34:25.497: W/System.err(3093):     at java.lang.reflect.Method.invokeNative(Native Method)
  07-18 11:34:25.497: W/System.err(3093):     at java.lang.reflect.Method.invoke(Method.java:511)
  07-18 11:34:25.497: W/System.err(3093):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
  07-18 11:34:25.497: W/System.err(3093):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
  07-18 11:34:25.497: W/System.err(3093):     at dalvik.system.NativeStart.main(Native Method)
  </code></pre>
  <p>Here is my Manifest:</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;manifest xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
      package=&quot;koodoo.pushtest&quot;
      android:versionCode=&quot;1&quot;
      android:versionName=&quot;1.0&quot; &gt;
  
      &lt;uses-sdk
          android:minSdkVersion=&quot;8&quot;
          android:targetSdkVersion=&quot;17&quot; /&gt;
  
      &lt;!-- GCM connects to Internet Services. --&gt;
      &lt;uses-permission android:name=&quot;android.permission.INTERNET&quot; /&gt;
  
      &lt;!-- GCM requires a Google account. --&gt;
      &lt;uses-permission android:name=&quot;android.permission.GET_ACCOUNTS&quot; /&gt;
  
      &lt;!-- Keeps the processor from sleeping when a message is received. --&gt;
      &lt;uses-permission android:name=&quot;android.permission.WAKE_LOCK&quot; /&gt;
  
      &lt;!-- Creates a custom permission so only this app can receive its messages. --&gt;
      &lt;permission
          android:name=&quot;koodoo.pushtest.permission.C2D_MESSAGE&quot;
          android:protectionLevel=&quot;signature&quot; /&gt;
  
      &lt;uses-permission android:name=&quot;koodoo.pushtest.permission.C2D_MESSAGE&quot; /&gt;
  
      &lt;!-- This app has permission to register and receive data message. --&gt;
      &lt;uses-permission android:name=&quot;com.google.android.c2dm.permission.RECEIVE&quot; /&gt;
  
      &lt;!-- Network State Permissions to detect Internet status --&gt;
      &lt;uses-permission android:name=&quot;android.permission.ACCESS_NETWORK_STATE&quot; /&gt;
  
      &lt;!-- Permission to vibrate --&gt;
      &lt;uses-permission android:name=&quot;android.permission.VIBRATE&quot; /&gt;
  
      &lt;application
          android:allowBackup=&quot;true&quot;
          android:icon=&quot;@drawable/ic_launcher&quot;
          android:label=&quot;@string/app_name&quot;
          android:theme=&quot;@style/AppTheme&quot; &gt;
          &lt;activity
              android:name=&quot;koodoo.pushtest.MainActivity&quot;
              android:label=&quot;@string/app_name&quot; &gt;
              
          &lt;/activity&gt;
  
          &lt;receiver
              android:name=&quot;com.google.android.gcm.GCMBroadcastReceiver&quot;
              android:permission=&quot;com.google.android.c2dm.permission.SEND&quot; &gt;
              &lt;intent-filter&gt;
  
                  &lt;!-- Receives the actual messages. --&gt;
                  &lt;action android:name=&quot;com.google.android.c2dm.intent.RECEIVE&quot; /&gt;
                  &lt;!-- Receives the registration id. --&gt;
                  &lt;action android:name=&quot;com.google.android.c2dm.intent.REGISTRATION&quot; /&gt;
  
                  &lt;category android:name=&quot;koodoo.pushtest&quot; /&gt;
              &lt;/intent-filter&gt;
          &lt;/receiver&gt;
  
          &lt;service android:name=&quot;com.google.android.gcm.GCMIntentService&quot; /&gt;
  
          &lt;activity
              android:name=&quot;koodoo.pushtest.RegisterActivity&quot;
              android:label=&quot;@string/title_activity_register&quot; &gt;
              
              &lt;intent-filter&gt;
                  &lt;action android:name=&quot;android.intent.action.MAIN&quot; /&gt;
  
                  &lt;category android:name=&quot;android.intent.category.LAUNCHER&quot; /&gt;
              &lt;/intent-filter&gt;
          &lt;/activity&gt;
      &lt;/application&gt;
  
  &lt;/manifest&gt;
  </code></pre>