Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/178.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
java.lang.NoClassDefFoundError:com.google.android.gms.gcm.GoogleCloudMessaging using java.lang.NoClassDefFoundError:_Java_Android_Eclipse_Google Play Services_Google Cloud Messaging - Fatal编程技术网

java.lang.NoClassDefFoundError:com.google.android.gms.gcm.GoogleCloudMessaging using java.lang.NoClassDefFoundError:

java.lang.NoClassDefFoundError:com.google.android.gms.gcm.GoogleCloudMessaging using java.lang.NoClassDefFoundError:,java,android,eclipse,google-play-services,google-cloud-messaging,Java,Android,Eclipse,Google Play Services,Google Cloud Messaging,这真让人讨厌。我浪费了一整天,但没有收到任何适当的结果。我正在尝试将谷歌云消息添加到我的应用程序中。我使用的是Eclipse的最新版本。ADT最新版本。我添加了google-play-services_lib作为库,在构建路径中添加了jar文件,但我的应用程序在下面的代码行中删除了: GoogleCloudMessaging regId = GoogleCloudMessaging.getInstance(_.appContext); java.lang.NoClassDefFoundErro

这真让人讨厌。我浪费了一整天,但没有收到任何适当的结果。我正在尝试将谷歌云消息添加到我的应用程序中。我使用的是Eclipse的最新版本。ADT最新版本。我添加了google-play-services_lib作为库,在构建路径中添加了jar文件,但我的应用程序在下面的代码行中删除了:

GoogleCloudMessaging regId = GoogleCloudMessaging.getInstance(_.appContext);

java.lang.NoClassDefFoundError!

如何解决这个问题?

问题是SDK和Eclipse的bug。库google-play-service.jar没有以正确的方式连接。用ADT和SDK完全重新安装Eclipse对我很有帮助。关于所有类的相关问题不仅仅是云消息。
不要忘记eclipse.ini文件中的问题。

看起来像是proguard混淆问题。我没有使用proguard。该应用程序似乎看不到google-play-services_lib类。我不明白为什么。尝试在Eclipse中清理/重建项目。这是运行时错误,将jar添加到类路径可以解决编译时错误,您需要确保jar已打包,以便在运行时可用。假设这个jar在运行时受支持,-->转到Eclipse右键单击project->转到Java构建路径->转到选项卡顺序。。。。然后选择罐子。已经做了所有这些显而易见的解决方案