I have the following issue:
I have two projects: jre1.7 and android 2.1. I'd like to build first as a jar file and use it as framework in the second project. I'm using eclipse and I've done things I usually do when I add external jar. (Right Click on Project - Build Path - Add external Jars), and seems like everything's fine, there are Referenced libraries folder appears and it contains jar.
But when I'm trying to compile Android project, it gives NoClassDefFound Error. Am I doing something wrong?
If you use Android SDK & ADT r17 or later, now Google recommended way of adding dependencies is:
Android SDK now automatically pick up and resolve dependencies for you, and you don't need other manual setup anymore (add jar to project build path). Check out the r17 changelog:
Added feature to automatically setup JAR dependencies. Any .jar files in the /libs folder are added to the build configuration (similar to how the Ant build system works). Also, .jar files needed by library projects are also automatically added to projects that depend on those library projects. (more info)
In addition, It is not explicitly stated in official dev guide that Android now fully support java 7, it is better to stay with JDK 6 at the moment.
Hope this helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With