title: Android Unit Testing in Eclipse: "Failed to launch test"
body: <p>I've just started trying to set up some unit testing in what is essentially my first android app.  I've had a hell of a time finding resource for this, but ultimately was able to scrape together what I <em>hoped</em> was the right path forward.</p>
  
  <p>First, this is what I've done.</p>
  
  <p>In Eclipse, I right-clicked my project that I'd like to create a test project for.
  I selected AndroidTools -> New Test Project
  I filled out the necessary information selecting a location of ../MyApp/tests for the new project and selected MyApp as the project to test.  Everything else was left as default.</p>
  
  <p>While this was executing I received the below as an error:</p>
  
  <blockquote>
    <p>[2011-04-01 08:13:02 - WPMSTest] R.java was modified manually! Reverting to generated version!</p>
  </blockquote>
  
  <p>But everything seemed okay.  I had a new source tree in my tests folder.</p>
  
  <p>So I tried to execute it (first on hardware, then on the emulator) by RunAs -> Android jUnit test.</p>
  
  <p>In both runs I received the below in my eclipse console:</p>
  
  <blockquote>
    <p>[2011-04-01 08:23:04 - WPMSTest] Launching instrumentation android.test.InstrumentationTestRunner on device emulator-5554<br/>[2011-04-01 08:23:04 - WPMSTest] Failed to launch test</p>
  </blockquote>
  
  <p>My two manifest files:</p>
  
  <p>WPMSTest:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.WPMS.test"
    android:versionCode="1"
    android:versionName="1.0"&gt;
  
  &lt;instrumentation android:targetPackage="com.WPMS" android:name="android.test.InstrumentationTestRunner" /&gt;
  &lt;application android:icon="@drawable/icon" android:label="@string/app_name"&gt;
  
  &lt;uses-library android:name="android.test.runner" /&gt;
  &lt;/application&gt;
  </code></pre>
  
  <p></p>
  
  <p>WPMS:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.WPMS"
    android:versionCode="1"
    android:versionName="1.0"&gt;
  &lt;application android:label="@string/app_name" android:icon="@drawable/ic_launcher_wpms"&gt;
      &lt;activity android:name=".WPMS"
                android:label="@string/app_name"&gt;
          &lt;intent-filter&gt;
              &lt;action android:name="android.intent.action.MAIN" /&gt;
              &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
          &lt;/intent-filter&gt;
      &lt;/activity&gt;
  &lt;/application&gt;    
  
  &lt;uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /&gt; 
  &lt;uses-permission android:name="android.permission.CHANGE_WIFI_STATE" /&gt;
  &lt;uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /&gt;
  </code></pre>
  
  <p> </p>
  
  <p>I'm hoping someone has seen something like this before and can shed some light on what I'm doing wrong.  Please let me know if you need any more files and I'll be sure to post them.</p>
  
  <p>Thanks!</p>