I am trying to build my android project using ant in command line mode. It works with eclipse and it used to work with ant until i installed the latest android sdk.
I run ant release -buildfile projectdir\build.xml
. The compilation process is ok, and after aligning the apk, it fails at runtime with ClassDefNotFoundError acra.ACRA
.
I have tried to remove any reference to acra from the project, but it will fail at runtime when trying to execute any code coming from a library jar.
My jars are in the libs
folder at the root of the project. And I sort of understood this would cause ant to link them into the apk. But it doesn't.
When I used a previous version of the android sdk, I had a file named build.properties
with an attribute referencing the jars folder external.libs.dir=libs
. But now I can't make this to work any more, even if I use the new attributes names jar.libs.dir=libs
and the new attributes file name ant.properties
.
I read that ClassDefNotFoundError is caused because at compile time the librairies are found, but they are not linked into the apk, so they can't be found at runtime. How can I link the external jars in the apk please ?
The compilation process is ok, and after aligning the apk, it fails at runtime with ClassDefNotFoundError acra.ACRA
There is no acra.ACRA
class in ACRA, at least not in the current edition. It's org.acra.ACRA
.
My jars are in the libs folder at the root of the project. And I sort of understood this would cause ant to link them into the apk. But it doesn't.
Yes, it does. Then ProGuard is removing them, unless you teach ProGuard not to.