我正在使用java 1.7在win 7 x64上使用3天的adt 17下载。
在我的新示例项目中添加一个jar(通过将其复制到libs /)编译得很好,但是在运行时抛出,因为jar中的类不在dexedlibs /中的相应jar中 - 该jar只包含一个清单。 / p>
相关链接:http://android.foxykeep.com/dev/how-to-fix-the-classdefnotfounderror-with-adt-17和http://tools.android.com/recent/dealingwithdependenciesinandroidprojects。
执行链接中建议的某些导出和订单操作无济于事。
这些天如何知道如何将jar添加到android项目中?
编辑:感谢max:jar是用java 1.7制作的,指定1.6停止了抛出,但由于某种原因我仍然得到一些缺失的方法(这些没有被调用,但它们被引用)。
12-20 23:02:13.689: W/Trace(27907): Unexpected value from nativeGetEnabledTags:
12-20 23:02:13.689: W/Trace(27907): Unexpected value from nativeGetEnabledTags: 0
12-20 23:02:13.689: W/Trace(27907): Unexpected value from nativeGetEnabledTags: 0
12-20 23:02:13.949: W/Trace(27907): Unexpected value from nativeGetEnabledTags: 0
12-20 23:02:13.949: W/Trace(27907): Unexpected value from nativeGetEnabledTags: 0
12-20 23:02:14.829: I/dalvikvm(27907): Could not find method com.tayek.utilities.Utilities.store, referenced from method com.tayek.qanda.Model.toPropertiesFile
12-20 23:02:14.829: W/dalvikvm(27907): VFY: unable to resolve static method 3399: Lcom/tayek/utilities/Utilities;.store (Ljava/io/File;Ljava/util/Properties;)V
12-20 23:02:14.829: D/dalvikvm(27907): VFY: replacing opcode 0x71 at 0x000f
12-20 23:02:14.849: I/dalvikvm(27907): Could not find method com.tayek.utilities.Utilities.store, referenced from method com.tayek.qanda.Model.toPropertiesFile
12-20 23:02:14.849: W/dalvikvm(27907): VFY: unable to resolve static method 3399: Lcom/tayek/utilities/Utilities;.store (Ljava/io/File;Ljava/util/Properties;)V
12-20 23:02:14.849: D/dalvikvm(27907): VFY: replacing opcode 0x71 at 0x0014
12-20 23:02:14.849: I/dalvikvm(27907): Could not find method com.tayek.utilities.Utilities.store, referenced from method com.tayek.qanda.Model.toPropertiesFile
12-20 23:02:14.849: W/dalvikvm(27907): VFY: unable to resolve static method 3400: Lcom/tayek/utilities/Utilities;.store (Ljava/io/Writer;Ljava/util/Properties;)V
12-20 23:02:14.849: D/dalvikvm(27907): VFY: replacing opcode 0x71 at 0x000f
12-20 23:02:14.849: I/dalvikvm(27907): Could not find method com.tayek.utilities.Utilities.store, referenced from method com.tayek.qanda.Model.toPropertiesFile
12-20 23:02:14.849: W/dalvikvm(27907): VFY: unable to resolve static method 3400: Lcom/tayek/utilities/Utilities;.store (Ljava/io/Writer;Ljava/util/Properties;)V
12-20 23:02:14.849: D/dalvikvm(27907): VFY: replacing opcode 0x71 at 0x0014
12-20 23:02:14.929: I/System.out(27907): Hospital Mortality Risk
12-20 23:02:14.969: W/Trace(27907): Unexpected value from nativeGetEnabledTags: 0
12-20 23:02:14.969: W/Trace(27907): Unexpected value from nativeGetEnabledTags: 0
12-20 23:02:14.969: W/Trace(27907): Unexpected value from nativeGetEnabledTags: 0
12-20 23:02:14.989: W/Trace(27907): Unexpected value from nativeGetEnabledTags: 0
12-20 23:02:15.029: W/Trace(27907): Unexpected value from nativeGetEnabledTags: 0
12-20 23:02:15.029: W/Trace(27907): Unexpected value from nativeGetEnabledTags: 0
12-20 23:02:15.040: W/Trace(27907): Unexpected value from nativeGetEnabledTags: 0
12-20 23:02:15.160: W/Trace(27907): Unexpected value from nativeGetEnabledTags: 0
12-20 23:02:15.160: W/Trace(27907): Unexpected value from nativeGetEnabledTags: 0
12-20 23:02:15.160: W/Trace(27907): Unexpected value from nativeGetEnabledTags: 0
12-20 23:02:15.169: W/Trace(27907): Unexpected value from nativeGetEnabledTags: 0
12-20 23:02:15.169: W/Trace(27907): Unexpected value from nativeGetEnabledTags: 0
12-20 23:02:15.169: W/Trace(27907): Unexpected value from nativeGetEnabledTags: 0
12-20 23:02:15.189: D/gralloc_goldfish(27907): Emulator without GPU emulation detected.
12-20 23:02:15.258: W/Trace(27907): Unexpected value from nativeGetEnabledTags: 0
12-20 23:02:15.299: W/Trace(27907): Unexpected value from nativeGetEnabledTags: 0
更新:使用普通类导入jar工作正常。
答案 0 :(得分:3)
如果您使用的是Java 7,则可以尝试更改Java库项目的运行时环境:
右键单击项目 - >属性 - > Java构建路径 - >库
选择JRE系统库[JavaSE-1.7]并单击编辑
将执行环境更改为JavaSE-1.6(jre7)
这对我使用ADT 21很有用。