With respect to this question, simply putting a jar into the /libs does not auto-magically include that jar into the .dex when invoking, say, ant debug. Not at least with Android SDK ver 15.
I’ve verified this by comparing the same project created two different ways. First (call it ‘Alpha’), by Eclipse. Second, via android create project ..., blah blah blah (the Ant way, call it ‘Bravo’).
Both Alpha and Bravo I built using ant debug. Comparing their /bin dirs, the jar under <project_root>/libs is missing from Bravo’s *.d; Alpha’s aren’t.
What magic is Eclipse embedding during project creation?
Better still, how can I ensure a jar is passed to ant debug|release when building a project, that a jar is included in the endstate?
You may just have to adjust the build.xml to include something like the following in the
-pre-buildnode if you want to hardwire it in. You can also add this in a custom target in the build.xml file that would able you do include from the command line when you want. Something like the following could work.Where
${src.folder}is defined in your ant.properties file.Something like
src.folder=PATHOFYOURJAR
Then you should be able to run
including the file.
I have had to manually create the libs folder in the past but I don’t see why you can’t do this through the build.xml file. Hope this helps!