tags:

views:

408

answers:

2

I have an existing project that builds fine using my IDE. I'd like to use the "android update" command to generate an ant buildfile for this project.

The buildfile is generated fine, but the build fails because it's not building with some jarfiles I have in my libs directory.

I'd like to figure out the proper way to tell ant to build with some external jar files in my libs directory. How should I do this? Is it a property in build.properties? Do I need to modify build.xml somehow? Or is there a different solution entirely?

+3  A: 

but the build fails because it's not building with some jarfiles I have in my libs directory.

And your error message is...what? I suspect you may be misinterpreting the error message.

I'd like to figure out the proper way to tell ant to build with some external jar files in my libs directory. How should I do this?

Just put them in libs/, as Ant will add everything in there to your build path. See this project, and this project, and this project for examples.

CommonsWare
Ah, the problem is that one of my dependencies is a project dependency rather than a jar dependency. I'll fix that.
Mike
Thanks commonsware. If you'd like to take a stab at a follow-up, I have another question here: http://stackoverflow.com/questions/2466437/how-to-build-an-android-test-app-with-a-dependency-on-another-app-using-ant
Mike
Yeah, I saw that one. I am not a fan of the Android test framework, so I don't know the answer there. Sorry!
CommonsWare
+1  A: 

I agree with Mark, however, if you're planning to modify your build script further - than you need to make it custom. Bring tasks from android/platforms/android-PLATFORMVERSION/templates/android_rules.xml to your build.xml and modify whatever you want to modify. Including location for external libs.

Alex Volovoy