android上GooglePlayServicesUtil的NoClassDefFoundError

android上GooglePlayServicesUtil的NoClassDefFoundError,android,eclipse,push-notification,google-cloud-messaging,Android,Eclipse,Push Notification,Google Cloud Messaging,我想在我的android应用程序中使用google cloud messeging。它对我有效,但在将我的类组织在包中并清理我的项目后,它停止工作,我得到以下错误: 致命异常:main 11-18 20:57:44.649:E/AndroidRuntime(15967): java.lang.NoClassDefFoundError: com.google.android.gms.common.GooglePlayServicesUtil 11-18 20:57:44.649:E/Android

我想在我的android应用程序中使用google cloud messeging。它对我有效,但在将我的类组织在包中并清理我的项目后,它停止工作,我得到以下错误:

致命异常:main 11-18 20:57:44.649:E/AndroidRuntime(15967): java.lang.NoClassDefFoundError: com.google.android.gms.common.GooglePlayServicesUtil 11-18 20:57:44.649:E/AndroidRuntime(15967):
activity.MainActivity.checkPlayServices(MainActivity.java:491)11-18 20:57:44.649:E/AndroidRuntime(15967):
activity.MainActivity.onCreate(MainActivity.java:72)11-18 20:57:44.649:E/AndroidRuntime(15967):在 android.app.Activity.performCreate(Activity.java:5133)

基本上我把我的活动从

myproject.android

由于上述错误,它停止了工作。对于gcm设置,我执行了以下操作:

1. Install Google Play services with SDK manager.
2. Import relevant classes into my activity
3. Added the google-play-services_lib.jar to build path
4. added it as library project


我的项目是一个maven项目,但是云消息服务没有maven repo。有什么想法吗?

谷歌PlayServices应该作为一个库项目(参见Android菜单)添加,而不是作为构建路径中的JAR


查看更多详细信息。

应将Google PlayServices添加为库项目(请参见Android菜单),而不是作为构建路径中的JAR

请参阅更多详细信息

1. Install Google Play services with SDK manager.
2. Import relevant classes into my activity
3. Added the google-play-services_lib.jar to build path
4. added it as library project