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?
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With