ADT20和外部JAR [英] ADT20 and External JAR
问题描述
我已经试过绝对一切,以避免出现NoClassDefFoundError尝试使用一个外部的jar时。没有骰子。 WTF ADT?!
I have tried absolutely everything to avoid the NoClassDefFoundError when trying to use an external jar. No dice. WTF ADT?!
这是一个干净的,全新的项目,增加外部罐子构建路径,放在库
文件夹,确保它的检查。 Android的 - >修复项目属性,添加和删除,冲洗和重复。我查了罐子的内容,以及我的文件在那里!我引用的这18种方法,去掉增加和重建,仍是邓恩的东西都找不到!
From a clean, brand new project, add external jar to build path, put in libs
folder, make sure it's checked. Android -> Fix Project Properties, adding and removing, rinsing and repeating. I checked the contents of the jar, and my files are there! I referenced it 20 ways, removed added and rebuilt, still the dern thing can't be found!!
有没有办法有人,从第1步,使用Eclipse和ADT 20条作出的Android里面的外部罐的工作?
Is there a way someone has, from step 1, made an external jar work inside Android using eclipse and ADT 20?
修改1
我尝试添加它变成只有库/
文件夹,并试图阿里什么建议<一href=\"http://stackoverflow.com/questions/10059152/java-lang-noclassdeffounderror-adt-17-known-issue\">in这太问题。我想我将不得不只是尝试和源添加到我的直接项目,但似乎太傻了。
I tried adding it into only the libs/
folder, and tried what Ali suggested in this SO question. I think I'm going to have to just try and add the source to my project directly, but that seems plain silly.
推荐答案
哦。我的。善良。
原来,的Android(仍然)不支持Java 7 ,当我建立了我的外部项目,它有1.7(Java 7中)作为默认的合规水平!切换下来,以配合我的Android项目的合规性使得这一切的花花公子。
Turns out, Android (still) does NOT support Java 7 and when I created my external project, it had the 1.7 (Java 7) as the default compliance level! Switching that down to match my Android project's compliance makes it all dandy.
像
List<MyClass> mList = new ArrayList<>();
和各种 @覆盖
显然做Android的坚持它在空气中的鼻子。
And various @Override
apparently made Android stick it's nose in the air.
希望这有助于别人出谁一直在这个问题上秃顶!
Hopefully this helps someone else out who's been going bald over this issue!
这篇关于ADT20和外部JAR的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!