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

无人久伴 提交于 2019-12-10 21:04:56

问题


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:

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


回答1:


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!



来源:https://stackoverflow.com/questions/24789701/java-lang-noclassdeffounderror-com-google-android-gms-gcm-googlecloudmessaging

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!