How to use ant to build with android
android, ant
Solution
I also had the same problem. My problem problem got solved by the following command.
android update project --path . --subprojects --target android-19
ANT will automatically set your sdk.dir into correct one. Don't put anything inside your local.properties.
# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must *NOT* be checked into Version Control Systems,
# as it contains information specific to your local configuration.
# location of the SDK. This is only used by Ant
# For customization when using a Version Control System, please read the
# header note.
Problem
I want to set up a ant build for my project. I found a tutorial saying that I need to write the following command in order to prepare for ant build: ``` android update project -p ``` then I get the result ``` Updated local.properties Updated file ./proguard-project.txt It seems that there are sub-projects. If you want to update them please use the --subprojects parameter. ``` so If I try ``` android update project -p . --subprojects ``` then I get: ``` Updated local.properties Updated file ./proguard-project.txt Error: The project either has no target set or the target is invalid. Please provide a --target to the 'android update' command. ``` and if I try ``` ant release ``` I get ``` sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through an env var ``` Can some one please help me in setting up the project with ant. Thanks