Adding an external jar to an android project

I have the following problem:

I have two projects: jre1.7 and android 2.1. I would like to first create a jar file and use it as a framework in a second project. I use eclipse and I did what I usually do when I add an external jar. (Right-click on the project - Build path - add external banks), and it seems that everything is in order, a folder with reference libraries appears and contains a jar.

But when I try to compile an Android project, it gives a NoClassDefFound Error. Am I doing something wrong?

+3
source share
3 answers

If you use the Android SDK and ADT r17 or later, now Google's recommended way to add dependencies is:

  • libs/folder .
  • jar libs/.

Android SDK , ( jar ). r17 changelog:

โ€‹โ€‹ JAR-. .jar /libs ( , Ant). , .jar, , , . ()

, , Android java 7, JDK 6 .

, .

+8

Android, Eclipse.

  • .
  • "".
  • "" " Java".
  • "".
  • " JAR" , .
  • " " "JarName.jar"
  • "".
+3

, ADT 17, classpath Android, , "" .

0

All Articles