title: How to use ant to build with android
body: <p>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:</p>
  
  <pre><code>android update project -p 
  </code></pre>
  
  <p>then I get the result</p>
  
  <pre><code>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.
  </code></pre>
  
  <p>so If I try </p>
  
  <pre><code>android update project -p . --subprojects
  </code></pre>
  
  <p>then I get:</p>
  
  <pre><code>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.
  </code></pre>
  
  <p>and if I try </p>
  
  <pre><code>ant release
  </code></pre>
  
  <p>I get</p>
  
  <pre><code>sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through an env var
  </code></pre>
  
  <p>Can some one please help me in setting up the project with ant.
  Thanks</p>