Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

java.lang.NoClassDefFoundError: com.google.android.gms.gcm.GoogleCloudMessaging after ADT update

I'm getting this error:

07-16 13:56:12.341: E/AndroidRuntime(23287): java.lang.NoClassDefFoundError: com.google.android.gms.gcm.GoogleCloudMessaging

after I updated ADT last week. The code:

public GCMRegisterTask(Context acontext) {
    this.context = acontext;
    if (gcm == null) {
        gcm = GoogleCloudMessaging.getInstance(context);
    }
}

The project doesn't show any compilation error, but when I try to debug this in my phone(Android 4.2, I've also tried in one table with Android 4.4) this error occurs. I've tried all the workarounds:

The Android Private Libraries export is checked:

The library is perfectly setted

enter image description here

The export checkbox is ok

I've also tried including only the google-play-services.jar in the libs/ folder and I'm getting the same error.

like image 875
Mariano L Avatar asked Dec 19 '25 01:12

Mariano L


1 Answers

This was the problem:

Android - Could not find google-play-services_lib.apk! error

I removed google-play-services from java build path->Projects and it worked!

like image 58
Mariano L Avatar answered Dec 20 '25 16:12

Mariano L



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!