它编译得很好。加载到我的测试设备就好了。当我运行它时,它崩溃了"抱歉,应用程序Ear of Bat(进程com.fleenlab.LWPA_EarOfBat)意外停止。请再试一次。"在设备屏幕上和一堆"未能解决"和#34;班级的联系失败"其次是"致命的例外...... NoClassDefFound"在logcat。
JAR是我在Eclipse上写的普通旧Java。
是的,这是许多其他人所遇到的同样问题。
我尝试了那种流行的解决方案(http://android.foxykeep.com/dev/how-to-fix-the-classdefnotfounderror-with-adt-17)。我把我的JAR放在libs文件夹中。没运气。
我还尝试了变体解决方案:将JAR称为外部JAR并设置" Order and Export"复选框。仍然没有运气。
我甚至反编译APK(使用apktool)来查看这些类是否正在打包。他们是。
更多信息 Android SDK工具R21.0.1 Android SDK Platform-tools R16.0.1 目标API 8 Eclipse SDK版本:3.7.2 Debian Squeeze
我受阻了。有线索吗?
(不能张贴图片但是这里是文本形式的logcat转储的最后一点)
11-30 21:30:44.140: W/dalvikvm(926): Link of class 'Lorg/fleen/core/diamondGrammar/Bubble;' failed
11-30 21:30:44.140: W/dalvikvm(926): Unable to match class for part: 'Lorg/fleen/core/diamondGrammar/Bubble;)Ljava/util/List;'
11-30 21:30:44.140: I/dalvikvm(926): Failed resolving Lorg/fleen/core/diamondGrammar/DNode; interface 667 'Ljavax/swing/tree/TreeNode;'
11-30 21:30:44.140: W/dalvikvm(926): Link of class 'Lorg/fleen/core/diamondGrammar/DNode;' failed
11-30 21:30:44.140: I/dalvikvm(926): Failed resolving Lorg/fleen/core/diamondGrammar/Bubble; interface 678 'Lorg/fleen/core/diamondGrammar/DNode;'
11-30 21:30:44.140: W/dalvikvm(926): Link of class 'Lorg/fleen/core/diamondGrammar/Bubble;' failed
11-30 21:30:44.150: W/dalvikvm(926): Unable to match class for part: 'Lorg/fleen/core/diamondGrammar/Bubble;)Ljava/util/List;'
11-30 21:30:44.150: I/dalvikvm(926): Failed resolving Lorg/fleen/core/diamondGrammar/DNode; interface 667 'Ljavax/swing/tree/TreeNode;'
11-30 21:30:44.150: W/dalvikvm(926): Link of class 'Lorg/fleen/core/diamondGrammar/DNode;' failed
11-30 21:30:44.150: I/dalvikvm(926): Failed resolving Lorg/fleen/core/diamondGrammar/Bubble; interface 678 'Lorg/fleen/core/diamondGrammar/DNode;'
11-30 21:30:44.150: W/dalvikvm(926): Link of class 'Lorg/fleen/core/diamondGrammar/Bubble;' failed
11-30 21:30:44.150: W/dalvikvm(926): Unable to match class for part: 'Lorg/fleen/core/diamondGrammar/Bubble;)Ljava/util/List;'
11-30 21:30:44.150: I/dalvikvm(926): Failed resolving Lorg/fleen/core/diamondGrammar/DNode; interface 667 'Ljavax/swing/tree/TreeNode;'
11-30 21:30:44.150: W/dalvikvm(926): Link of class 'Lorg/fleen/core/diamondGrammar/DNode;' failed
11-30 21:30:44.150: I/dalvikvm(926): Failed resolving Lorg/fleen/core/diamondGrammar/Bubble; interface 678 'Lorg/fleen/core/diamondGrammar/DNode;'
11-30 21:30:44.150: W/dalvikvm(926): Link of class 'Lorg/fleen/core/diamondGrammar/Bubble;' failed
11-30 21:30:44.190: W/dalvikvm(926): Unable to match class for part: 'Lorg/fleen/core/diamondGrammar/Bubble;)Ljava/util/List;'
11-30 21:30:44.190: I/dalvikvm(926): Failed resolving Lorg/fleen/core/diamondGrammar/DNode; interface 667 'Ljavax/swing/tree/TreeNode;'
11-30 21:30:44.190: W/dalvikvm(926): Link of class 'Lorg/fleen/core/diamondGrammar/DNode;' failed
11-30 21:30:44.190: I/dalvikvm(926): Failed resolving Lorg/fleen/core/diamondGrammar/Bubble; interface 678 'Lorg/fleen/core/diamondGrammar/DNode;'
11-30 21:30:44.190: W/dalvikvm(926): Link of class 'Lorg/fleen/core/diamondGrammar/Bubble;' failed
11-30 21:30:44.190: W/dalvikvm(926): Unable to match class for part: 'Lorg/fleen/core/diamondGrammar/Bubble;)Ljava/util/List;'
11-30 21:30:44.240: D/dalvikvm(926): GC_CONCURRENT freed 634K, 53% free 2792K/5831K, external 716K/1038K, paused 2ms+4ms
11-30 21:30:44.560: D/dalvikvm(926): GC_CONCURRENT freed 368K, 51% free 2874K/5831K, external 716K/1038K, paused 2ms+2ms
11-30 21:30:44.660: W/dalvikvm(926): threadid=9: thread exiting with uncaught exception (group=0x40082560)
11-30 21:30:44.660: E/AndroidRuntime(926): FATAL EXCEPTION: Thread-10
11-30 21:30:44.660: E/AndroidRuntime(926): java.lang.NoClassDefFoundError: org.fleen.core.diamondGrammar.Grid
11-30 21:30:44.660: E/AndroidRuntime(926): at com.fleenlab.LWPA_EarOfBat.LoopingTunnelFlowVFrameBlock_TF0000_Tight.initRootAndCore(LoopingTunnelFlowVFrameBlock_TF0000_Tight.java:90)
11-30 21:30:44.660: E/AndroidRuntime(926): at org.fleen.loopingTunnelFlowVFrameSequence.LoopingTunnelFlowVFrameBlock_Abstract.<init>(LoopingTunnelFlowVFrameBlock_Abstract.java:100)
11-30 21:30:44.660: E/AndroidRuntime(926): at com.fleenlab.LWPA_EarOfBat.LoopingTunnelFlowVFrameBlock_TF0000_Tight.<init>(LoopingTunnelFlowVFrameBlock_TF0000_Tight.java:43)
11-30 21:30:44.660: E/AndroidRuntime(926): at com.fleenlab.LWPA_EarOfBat.LoopingTunnelFlowVFrameSeq_Tight.getBlock(LoopingTunnelFlowVFrameSeq_Tight.java:17)
11-30 21:30:44.660: E/AndroidRuntime(926): at com.fleenlab.LWPA_EarOfBat.LoopingTunnelFlowVFrameSeq_Tight.<init>(LoopingTunnelFlowVFrameSeq_Tight.java:14)
11-30 21:30:44.660: E/AndroidRuntime(926): at com.fleenlab.LWPA_EarOfBat.Generator.getSeq(Generator.java:110)
11-30 21:30:44.660: E/AndroidRuntime(926): at com.fleenlab.LWPA_EarOfBat.Generator$Initializer.run(Generator.java:78)
答案 0 :(得分:0)
这是一个依赖性的东西。 Grid依赖于TreeNode,它在Swing中,而不在JAR中。我的解决方案是摆脱TreeNode。反正真的不需要它。现在工作正常。
我知道logcat说NoClassDefFound发生在Grid,但问题实际上并不是缺少Grid类def,它是Grid所引用的类的缺失def。