Autore Topic: [GCM for Android] Unable to instantiate receiver GCMBroadcastReceiver  (Letto 686 volte)

Offline mitsus

  • Nuovo arrivato
  • *
  • Post: 11
  • Respect: 0
    • Mostra profilo
  • Dispositivo Android:
    Motorola RAZR HD
  • Play Store ID:
    mitsusdev
  • Sistema operativo:
    Debian 6
Ciao ragazzi,
è da qualche giorno che provo ad aggiungere alla mia app le notifiche push come indicato da google, per sostituire le "Deprecate". Ho seguito alla lettera la documentazione ufficiale reperibile all'indirizzo http://developer.android.com/google/gcm/client.html[/url]. la registrazione sul mio server avviene con successo, ma se provo a mandarmi una push di test, ottengo questo errore:

Codice: [Seleziona]
java.lang.RuntimeException: Unable to instantiate receiver com.example.myapp.gcm.GCMBroadcastReceiver: java.lang.ClassNotFoundException: Didn't find class "com.example.myapp.gcm.GCMBroadcastReceiver" on path: /data/app/com.example.myapp-1.apk

le ho provate tutte, cambiano in tutti i modi il MANIFEST, spostando tutti i files relativi nella directory root...ma nulla.
Di seguito il mio MANIFEST

Codice: [Seleziona]
<manifest xmlns:android="[url]http://schemas.android.com/apk/res/android"
    package="com.example.myapp"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="15" />
   
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
 <uses-permission android:name="android.permission.READ_CONTACTS" />
    <!-- Required to show current location -->
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <!-- GCM requires a Google account. -->
    <uses-permission android:name="android.permission.GET_ACCOUNTS" />
 
    <!-- Keeps the processor from sleeping when a message is received. -->
    <uses-permission android:name="android.permission.WAKE_LOCK" />
     <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
    <!-- Creates a custom permission so only this app can receive its messages. -->
    <permission
        android:name="com.example.myapp.permission.C2D_MESSAGE"
        android:protectionLevel="signature" />
 
    <uses-permission android:name="com.example.myapp.permission.C2D_MESSAGE" />
 
    <!-- This app has permission to register and receive data message. -->
   
 
    <!-- Permission to vibrate -->
    <uses-permission android:name="android.permission.VIBRATE" />
   
    <!-- Required OpenGL ES 2.0. for Maps V2 -->
    <uses-feature
        android:glEsVersion="0x00020000"
        android:required="true" />

    <!-- Requires OpenGL ES version 2 -->
    <uses-feature
        android:glEsVersion="0x00020000"
        android:required="true" />
    <!-- Goolge Maps API Key -->
   
   
    <application
        android:name="com.example.myapp.globals.MyAppGlobalVars"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/Theme.Sherlock.Light" >
        <activity android:name="com.example.myapp.Splash"
            android:screenOrientation="portrait"
             >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        ........
        ........
        ........
        <receiver
            android:name=".GCMBroadcastReceiver"
            android:permission="com.google.android.c2dm.permission.SEND" >
            <intent-filter>

                <!-- Receives the actual messages. -->
                <action android:name="com.google.android.c2dm.intent.RECEIVE" />
                <!-- Receives the registration id. -->
                <action android:name="com.google.android.c2dm.intent.REGISTRATION" />

                <category android:name="com.example.myapp" />
            </intent-filter>
        </receiver>
        <service android:name=".GCMIntentService" />
       
        <meta-data
            android:name="com.google.android.gms.version"
            android:value="@integer/google_play_services_version" />

       
    </application>
   
</manifest>

Ho provato anche a compilare il progetto di esempio fornito da google qui https://code.google.com/p/gcm/source/browse/#git%2Fgcm-client...stesso errore!! Ho cominciato a pensare che potrebbe essere la google_play_service_lib.jar ??
Qualcuno ha idea di come posso risolvere?

Grazie