I have problems with GCMRegistrar, here is the code:
// Make sure the device has the proper dependencies.
GCMRegistrar.checkDevice(this);
GCMRegistrar.checkManifest(this); <- this line is the problem (I suppose)
regId = GCMRegistrar.getRegistrationId(this);
When I change that line to a comment the app doesn't crash but the regId is empty, and when I try to use that line it makes my app crash, I don't know why so I hope you can help me. :)
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.chattest1"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="8" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<permission
android:name="com.example.chattest1.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<uses-permission android:name="com.example.chattest1.permission.C2D_MESSAGE" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.VIBRATE" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.example.chattest1.RegisAct"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.example.chattest1.Main"
android:label="@string/title_activity_regis" >
</activity>
</application>
</manifest>