You must add .jar to build path on Eclipse (right clic> build 
path>configure build path)
Maybe have a look to your import, or SDK version updates...

Jeremy

Le vendredi 29 juin 2012 15:42:35 UTC+2, Divyang a écrit :
>
> I tried to integrate new GCM Google Cloud Messaging. I put the below 
> function, but it gives the error mentioned below. Any help would be 
> appreciated.
>
> I put the gcm.jar for client into my libs folder and provided reference to 
> it to use it in my android application.
>
>     private void registerForGCM(){
>         try {
>             GCMRegistrar.checkDevice(Login.this);
>             GCMRegistrar.checkManifest(Login.this);
>             final String regId = 
> GCMRegistrar.getRegistrationId(Login.this);
>             if (regId.equals("")) {
>               GCMRegistrar.register(this, SENDER_ID);
>             } else {
>               Log.v("GCM (Google Cloud Messaging)", "Already registered");
>             }
>         } catch (Exception e) {
>             e.printStackTrace();
>         }
>     }
>
> Error:
> java.lang.NoClassDefFoundError: com/google/android/gcm/GCMRegistrar
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to