问题
This is really annoying. I've wasted a whole day but haven't received any proper result. I'm trying to add Google Cloud Messages into my app. I'm using Eclipse last version. ADT last version. I've added google-play-services_lib as Library, added the jar file in Build path but my app drops at the code line below:
GoogleCloudMessaging regId = GoogleCloudMessaging.getInstance(_.appContext);
java.lang.NoClassDefFoundError!
How to solve this problem?
回答1:
The problem is the bug of SDK and Eclipse. The library google-play-service.jar didn't attached in a proper way. Just full reinstalling Eclipse (with ADT) and SDK helped to me. The connected question about all classes (not only Cloud Messages) is here. Do not forget about memory increasing in eclipse.ini file.
来源:https://stackoverflow.com/questions/29898396/java-lang-noclassdeffounderror-com-google-android-gms-gcm-googlecloudmessaging