Google Cloud Messaging - GCM - SERVICE_NOT_AVAILABLE

Ich versuche, das neue GCM zu implementieren, ich folge Googleerkläre dich : http://developer.android.com/guide/google/gcm/gs.html

Ich stecke fest, wenn ich meine Geräte-Registrierungs-ID bekomme!

Meine App versucht weiterhin, eine Verbindung mit dem Google-Server herzustellen. Hier meine Fehlerprotokolle:

onReceive: com.google.android.gcm.intent.RETRY
GCM IntentService class: com.dombox.app.GCMIntentService
Acquiring wakelock
[GCMIntentService] start
Registering app com.dombox.app of senders _my_sender_id_
Releasing wakelock
onReceive: com.google.android.c2dm.intent.REGISTRATION
GCM IntentService class: com.dombox.app.GCMIntentService
Acquiring wakelock
[GCMIntentService] start
handleRegistration: registrationId = null, error = SERVICE_NOT_AVAILABLE, unregistered = null
Registration error: SERVICE_NOT_AVAILABLE
Scheduling registration retry, backoff = 912617 (768000)
Releasing wakelock

Hier ist mein Aktivitätscode, der nach einem Ausweis fragt:

    try{
        Log.i(TAG, "[checkNotifRegistration] checkDevice");
        GCMRegistrar.checkDevice(this);
        Log.i(TAG, "[checkNotifRegistration] checkManifest");
        GCMRegistrar.checkManifest(this);
        if (GCMRegistrar.isRegistered(this)) {
            Log.i(TAG, "[checkNotifRegistration] reg id : "+GCMRegistrar.getRegistrationId(this));
        }
        final String regId = GCMRegistrar.getRegistrationId(this);
        if (regId.equals("")) {
            // SENDER_ID is my project id into google account url
            GCMRegistrar.register(this, SENDER_ID);
            Log.i(TAG, "[checkNotifRegistration] reg id : "+GCMRegistrar.getRegistrationId(this));
        } else {
            Log.i(TAG, "[checkNotifRegistration] already registered as : " + regId);
        }
    } catch(Exception e){
        Log.e(TAG, "[checkNotifRegistration] Exception : "+e.getMessage());
        e.printStackTrace();
    }

Hier mein Service Code

public class GCMIntentService extends GCMBaseIntentService {

private static final String TAG = "GCMIntentService";

public GCMIntentService() {
    super(SENDER_ID);
           // SENDER_ID is my project id into google account url
    // TODO Auto-generated constructor stub
    Log.d(TAG, "[GCMIntentService] start");
}


public GCMIntentService(String senderId) {
    super(senderId);
    // TODO Auto-generated constructor stub
    Log.d(TAG, "[GCMIntentService] start - sender Id : "+senderId);
}
}

Und hier ist mein Android-Manifest:

<permission android:name="com.dombox.app.permission.C2D_MESSAGE" android:protectionLevel="signature" />
<uses-permission android:name="com.dombox.app.permission.C2D_MESSAGE" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />

<application
    android:icon="@drawable/icon"
    android:label="@string/app_name" >

    <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.myapp.app" />
        </intent-filter>
    </receiver>

<service android:name=".GCMIntentService" android:enabled="true"/>

    <activity
        android:name=".activity.Myapp"
        android:label="@string/app_name" >

        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>

    </activity>

Ich folge den Anweisungen von Google, habe mich jedoch an diesen SERVICE_NOT_AVAILABLE-Fehler gehalten.

Was mache ich falsch ?

Antworten auf die Frage(6)

Ihre Antwort auf die Frage