Android: class NOT FOUND in Eclipse-built-in external bank, but FOUND in Netbeans-built

This is a continuation of this question: "android cannot find class from external jar"

I have an Android project in Eclipse that uses an external JAR. The JAR is extremely simple: it contains a toy class that calculates the square of a number and returns the result as a String.

Bad . If I create a JAR in Eclipse by creating a regular Java project with a class, then exporting it to a jar file and finally adding this JAR to the build path of the Android project, I get a runtime exception that this class cannot be found.

GOOD . If I create a JAR in Netbeans and add that JAR to the build path (in Eclipse), everything will work fine.

I really unzipped both banks to compare the contents. There seems to be a difference in the .class files, but they are not human readable, so I cannot get further promotion.

So my q is this : what can I change in the Eclipse export to make the external jar “good”? What makes NB correct if Eclipse does wrong? Or am I just resorting to creating all my external JARs in NB?

thanks

+4
source share
2 answers

On the Order and Export tab of the Build Path screen, select the check box for the missing banner

+6
source

If your problem is with ADT 17, the easiest solution is to create the libs directories in your project and copy the jar into it. see link

+1
source

Source: https://habr.com/ru/post/1382591/


All Articles