简体   繁体   中英

ADT20 and External JAR

在此处输入图片说明 I have tried absolutely everything to avoid the NoClassDefFoundError when trying to use an external jar. No dice. WTF ADT?!

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!!

Is there a way someone has, from step 1, made an external jar work inside Android using eclipse and ADT 20?

Edit 1

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.

Oh. My. Goodness.

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.

Stuff like

List<MyClass> mList = new ArrayList<>();

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!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM