this is a weird one. i have a -pre-compile target in my custom_rules.xml. in here, some JARs get copied into the libs folder.
if i do a clean build, it fails at runtime because those libraries do not get included in the .apk. looking at the output of ant -v ..., Dx is not processing those libs. so, while the project is being compiled against against those libraries, they are not included at the Dx phase.
if i subsequently do a non-clean ant debug, everything is fine, as the JARs copied by -pre-compile were already there at the start of the build.
any ideas what i’m doing wrong?
i eventually figured this out by painstakingly adding echo statements to the
.../tools/ant/build.xmlfrom the SDK.the path that includes the libraries in
.../libsfor Dx is defined in the-setuptask. this is in the chain before-pre-compileor-pre-build, so if you copy JARs into your.../libsfolder at either of those points, it’s too late.i ended up overriding the
-setuptask, as so,note the syntax for calling through to the overridden
-setuptask … the project name defined in theprojecttag appended with the task name, as defined in thebuild.xmlimported from the SDK.