Android – Include jar into apk with eclipse

androidapkjar

I am trying to include a jar file in my apk file.

I tried the following:

    • copy the jar into lib directory in my project
    • add jar to path
    • enable the jar for export
    • simply add the jar to my project path (location anywhere else)
    • enable jar for export

But the apk does not include the jar. When I try to lanch the application the console tells me:

Installation error: INSTALL_FAILED_MISSING_SHARED_LIBRARY
Please check logcat output for more details.
Launch canceled!

I'm using

Eclipse IDE for Java Developers
Version: Indigo Service Release 1
Build id: 20110916-0149

and

Android Development Toolkit
Version: 16.0.1.v201112150204-238534

EDIT:
This problem is solved. If I don't declare the libary as needed in the manifest it works.
(Strange behaviour)

Best Solution

Make sure your .JAR is created with JavaSE-1.6, not 1.7