title: How to build an android test app with a dependency on another app using ant?
body: <p>I have a module called MyApp, and another module called MyAppTests which has a dependency on MyApp.  Both modules produce APKs, one named MyApp.apk and the other MyAppTests.apk.</p>
  
  <p>I normally build these in IntelliJ or Eclipse, but I'd like to create an ant buildfile for them for the purpose of continuous integration.</p>
  
  <p>I used "android update" to create a buildfile for MyApp, and thanks to <a href="https://stackoverflow.com/questions/2465285/how-to-build-an-android-app-with-external-libraries-using-ant/">commonsware's answer</a> to my previous question I've been able to build it successfully using ant.</p>
  
  <p>I'd now like to build MyAppTests.apk using ant.  I constructed the buildfile as before using "android update", but when I run it I get an error indicating that it's not finding any of the classes in MyApp.</p>
  
  <p>Taking a que from my previous question, I tried putting MyApp.apk into my MyAppTests/libs, but unfortunately that didn't miraculously solve the problem.</p>
  
  <p>What's the best way to build a test app APK using ant when it depends on classes in another APK?</p>
  
  <pre><code>$ ant debug
  Buildfile: build.xml
      [setup] Project Target: Google APIs
      [setup] Vendor: Google Inc.
      [setup] Platform Version: 1.5
      [setup] API level: 3
      [setup] WARNING: No minSdkVersion value set. Application will install on all Android versions.
  
  dirs:
       [echo] Creating output directories if needed...
  
  resource-src:
       [echo] Generating R.java / Manifest.java from the resources...
  
  aidl:
       [echo] Compiling aidl files into Java classes...
  
  compile:
      [javac] Compiling 5 source files to /Users/mike/Projects/myapp/android/MyAppTests/bin/classes
      [javac] /Users/mike/Projects/myapp/android/MyAppTests/src/com/myapp/test/GsonTest.java:3: cannot find symbol
      [javac] symbol  : class MyApplication
      [javac] location: package com.myapp
      [javac] import com.myapp.MyApplication;
      [javac]                ^
  </code></pre>