|
As a workaround to #1, you can right click on Libraries, Add Jar or Add Library and the add this to your build.xml (overriding the project: Note that this doesn't properly escape spaces in path names, I'm not sure how to do dynamic <arg/> elements in an ant build file. <target depends="init,compile,-pre-pre-jar,-pre-jar" name="-dex"> test The other thing that would be really nice to have, is a way to have resources inside a library, but I'm not sure the SDK supports that yet. The aapt -x switch get's you part way there, and you can references resources from your library in your project's java code, but the aapt -I switch doesn't seem to actually include the library's references in the final projects references. This does not seem to work, i added it to my build.xml and it did something, the apk file changed in size, (about 2 kb when the external jar is 14 kb), and i get "could not find class" message when calling the code. I found this: but this does not work for me, so i looked a little bit in my projects... add to build.xml: <project> It doesn't work with native libraries as well (.so files). For example, on compile it should automatically add the folder /lib/armeabi/libHello.so to the .apk, but at the moment it doesn't. What I haven't yet figured out though, is how to properly modify the ANT script to check for a /libs/armeabi directory and add all .so files to /lib/armeabi/*. I tried the following so far (in the build.xml): <target name="-pre-jar"> That compiles fine, but get the following error at run-time: Failure [INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES] Any ideas? Found a solution for the native libraries - need to modify the build.xml: <target name="-post-jar"> |
||||||||||||||||||||||||||||||||||||||||
Comment #1 From jcpalmer@kenai.com 2008-11-25 21:38:39 -------
Forgot to explicitly state that added it is the files/folders inside jars of
the external libraries are added into the build, not a jar within a jar. The
Mobility Pack just adds the files/folders. Not sure a jar within a jar would
even work.