I encountered a strange problem - I've been using GCM in my application for quite a long time and everything works perfectly. However, before a release to Google Play I changed my application package name from com.android.testapp
to com.android.recognition
and after this GCM stopped working. At first I got en error GCM sender id not set on constructor
and fixed it by overriding getSenderIds(Context context)
, but now I can't get a registration ID. Here are the messages from logcat:
How can I fix this? When I switched to a new package I changed everything in the manifest file to the new package:
<receiver
android:name="com.google.android.gcm.GCMBroadcastReceiver"
android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="com.android.recognition" />
</intent-filter>
</receiver>
So what is the problem behind this? Can renaming the application package cause this or is there another reason?
The problem is answered, in my case it was little more complicated.
Wrong clock caused problem for me. :)