在Nexus 4获取的NoClassDefFoundError与谷歌云消息(GCM) [英] Getting NoClassDefFoundError with Google Cloud Messaging (GCM) on Nexus 4
本文介绍了在Nexus 4获取的NoClassDefFoundError与谷歌云消息(GCM)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在我的类路径中gcm.jar,所以Eclipse编译该项目,但它在我的Nexus 4设备上失败
11月2日至24日:52:12.645:E / AndroidRuntime(30240):致命异常:主要
十一月2日至24日:52:12.645:E / AndroidRuntime(30240):java.lang.NoClassDefFoundError的:com.google.android.gcm.GCMRegistrar
十一月2日至24日:52:12.645:E / AndroidRuntime(30240):在com.foo.closethedoor.CloseTheDoorActivity.onCreate(CloseTheDoorActivity.java:77)
解决方案
我有gcm.jar在我的类路径
块引用>它需要在项目的
库/
目录。不要只操纵了Eclipse手动构建路径 - 这将让你的编译的对JAR,但不会的船的与您的APK的JAR。把JAR中库/
同时做两件事。I have the gcm.jar in my classpath, so eclipse compiles the project but it fails on my Nexus 4 device with
02-24 11:52:12.645: E/AndroidRuntime(30240): FATAL EXCEPTION: main 02-24 11:52:12.645: E/AndroidRuntime(30240): java.lang.NoClassDefFoundError: com.google.android.gcm.GCMRegistrar 02-24 11:52:12.645: E/AndroidRuntime(30240): at com.foo.closethedoor.CloseTheDoorActivity.onCreate(CloseTheDoorActivity.java:77)
解决方案I have the gcm.jar in my classpath
It needs to be in your project's
libs/
directory. Do not just manipulate the Eclipse build path manually -- that will allow you compile against the JAR but does not ship the JAR with your APK. Putting the JAR inlibs/
does both.这篇关于在Nexus 4获取的NoClassDefFoundError与谷歌云消息(GCM)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文