I want to build an Android application using ant (as generated by the android tool). The application needs external libraries that are available as .jar. Since other (related) projects need the same libraries, I want to store them in a common place, outside of /libs (let's say "../somewhere/else/something.jar"). The application additionally needs a shared object, which is stored in /libs/armeabi/libSomething.so (it is copied there by ndk-build).
Does anybody know how I must configure my stuff to embed the classes in ../somewhere/else/something.jar into my .APK?
I tried various ways in ant.properties
...
java.compiler.classpath=../somewhere/else/something.jar
jar.libs.dir=libs:../somewhere/else
external.libs.dir=libs:../../ext/android/tomtom
and build.xml
...
<package-helper>
<extra-jars>
<jarfile path="../somewhere/else/something.jar" />
</extra-jars>
</package-helper>
...
<!-- From http://stackoverflow.com/questions/3217643/how-to-add-external-jar-libraries-to-an-android-project-from-the-command-line -->
<target name="-pre-compile">
<!-- HACK to add the android-support-v4.jar to the classpath directly from the SDK -->
<echo>ORIGINAL jars.path : ${toString:project.all.jars.path}</echo>
<path id="project.all.jars.path.hacked">
<path path="${toString:project.all.jars.path}"/>
<!-- <path path="${sdk.dir}/extras/android/support/v4/android-support-v4.jar"/> -->
</path>
<path id="project.all.jars.path">
<path path="${toString:project.all.jars.path.hacked}"/>
</path>
<echo>HACKED jars.path : ${toString:project.all.jars.path}</echo>
None of the above mentioned ways worked... :(
Does anybody have a solution? I am searching and trying now for hours, and I can't imagine that nobody ever had the same problem.
Thanks for any help!!!