title: Unable to build android test project with ant
body: <p>I have a sample Android app, created with Eclipse, having one Activity.
  I ran this command to build the ant build files for this project:</p>
  
  <pre><code>android create project --target 8 --name SampleApp --path ./SampleApp --activity MainActivity --package com.example.sampleapp
  </code></pre>
  
  <p>Running "ant debug" successfully builds the project and creates the apk files: </p>
  
  <pre><code>-post-build:
  
  debug:
  
  BUILD SUCCESSFUL
  Total time: 1 second
  </code></pre>
  
  <p>Now, I want to create an Android Test Project. I run this command:</p>
  
  <pre><code>android create test-project -m ../SampleApp -n SampleAppTest -p SampleAppTest
  </code></pre>
  
  <p>This successfully created the SampleAppTest directory containing the build files. I have a single class, src/com/example/sampleapp/MainActivityTest.java:</p>
  
  <pre><code>package com.example.sampleapp;
  
  import android.test.ActivityInstrumentationTestCase2;
  
  public class MainActivityTest extends ActivityInstrumentationTestCase2&lt;MainActivity&gt; {
  
      public MainActivityTest() {
          super("com.example.sampleapp", MainActivity.class);
      }
  
  }
  </code></pre>
  
  <p>I want to build this project. In the tutorial found here <a href="http://developer.android.com/tools/testing/testing_otheride.html#RunTestsAnt" rel="nofollow">http://developer.android.com/tools/testing/testing_otheride.html#RunTestsAnt</a> it says I should be able to do "ant run-tests". Unfortunately this target does not exist:</p>
  
  <pre><code>$ ant run-tests
  Buildfile: /Users/cmuraru/Work/androidtest/SampleAppTest/build.xml
  
  BUILD FAILED
  Target "run-tests" does not exist in the project "SampleAppTest". 
  
  Total time: 0 seconds
  </code></pre>
  
  <p>If I try "ant debug" I receive an error when compiling, stating that the MainActivity class (from SampleApp) can not be found.</p>
  
  <pre><code>-compile:
      [javac] Compiling 2 source files to /Users/cmuraru/Work/androidtest/build/test/classes
      [javac] /Users/cmuraru/Work/androidtest/SampleAppTest/src/com/example/sampleapp/MainActivityTest.java:15: cannot find symbol
      [javac] symbol: class MainActivity
      [javac] public class MainActivityTest extends ActivityInstrumentationTestCase2&lt;MainActivity&gt; {
      [javac]                                                                        ^
      [javac] /Users/cmuraru/Work/androidtest/SampleAppTest/src/com/example/sampleapp/MainActivityTest.java:18: cannot find symbol
      [javac] symbol  : class MainActivity
      [javac] location: class com.example.sampleapp.MainActivityTest
      [javac]         super("com.example.sampleapp", MainActivity.class);
      [javac]                                        ^
      [javac] 2 errors
  
  BUILD FAILED
  /Users/cmuraru/Work/android-sdk-macosx/tools/ant/build.xml:705: The following error occurred while executing this line:
  /Users/cmuraru/Work/android-sdk-macosx/tools/ant/build.xml:718: Compile failed; see the compiler error output for details.
  
  Total time: 1 second
  </code></pre>
  
  <p>When trying "ant test", it also fails:</p>
  
  <pre><code>test:
       [echo] Running tests ...
       [exec] INSTRUMENTATION_STATUS: id=ActivityManagerService
       [exec] INSTRUMENTATION_STATUS: Error=Unable to find instrumentation info for: ComponentInfo{com.example.sampleapp.tests/android.test.InstrumentationTestRunner}
       [exec] INSTRUMENTATION_STATUS_CODE: -1
       [exec] android.util.AndroidException: INSTRUMENTATION_FAILED: com.example.sampleapp.tests/android.test.InstrumentationTestRunner
       [exec]     at com.android.commands.am.Am.runInstrument(Am.java:616)
       [exec]     at com.android.commands.am.Am.run(Am.java:118)
       [exec]     at com.android.commands.am.Am.main(Am.java:81)
       [exec]     at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
       [exec]     at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:237)
       [exec]     at dalvik.system.NativeStart.main(Native Method)
  </code></pre>
  
  <p>What am I missing/doing wrong here? Any help is gladly appreciated.</p>