Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Build Android Library Project With Ant

Tags:

android

build

ant

I am having trouble building my Android library project with ant. When I try to run ant release, it says Target "release" does not exist in the project "MyProject".

I then assumed that perhaps libraries do not get build with release/debug, so I started using ant compile, which seems to work. I then zip the folder manually using java's zip utility and rename it to .apk. I am guessing this is the wrong way to do this.

Can anyone show me how to build an Android library project using ant?

like image 879
NeilMonday Avatar asked Aug 30 '11 13:08

NeilMonday


2 Answers

I then assumed that perhaps libraries do not get build with release/debug

Correct.

I am guessing this is the wrong way to do this.

Also correct.

Can anyone show me how to build an Android library project using ant?

You typically do not build an Android library project. You build other projects that reference the Android library project. Creating projects that reference the library project, for use with Ant, is covered in the Android documentation. More information about the role of Android library projects can also be found in the Android documentation.

like image 151
CommonsWare Avatar answered Oct 18 '22 09:10

CommonsWare


I had the same trouble with a target "nodeps" that was not known by Ant when building a project that was referencing a library. I added a fake target "nodeps", then I get the target "release" unknown. Wrong way.

Solution : in my referenced library directory, I run the command android update project -p . that created the build.xml compatible with Ant build.

like image 43
Alexis Pautrot Avatar answered Oct 18 '22 07:10

Alexis Pautrot