Accepted answer

in the run configuration you may have android junit test, if there are any new launch configuration entries inside this, you delete it and then run your application it will run.

note - this is likely to be the solution if you tried to run the test case before adding the correct lines to the manifest as described in the answer from josef. if you have done this, delete the configuration (which will be complaining that no instrumentation test runner has been specified in its header) and then run it as an android junit test again and it will create a valid configuration picking up the correct stuff that you have added to the manifest (see josef's answer for this).


the problem is when you created the project, you would have had a avd, so these configuration would be missing. my suggested way is first create the avd and then create the android project :).

if you would have already created the project and if does not have much code you have written i would suggest to delete it and create a new one.


besides ensuring that the below items are declared in the manifest of your test app, check in the run configuration that the "instrumentation runner" field is set to


this what i ran into when figuring out why i test wouldn't run.


<instrumentation android:name="android.test.instrumentationtestrunner"
 android:label="your tests label" />


<uses-library android:name="android.test.runner" />


it's not in your code, it's just eclipse is a little buggy. in your run configurations it could be trying to run a junit test, but select run application and that error will go away.


just do a right click on your test class from eclipse ide and click on "run as". after this select "run configuration" which will launch a confiuration window in eclipse and you need to click on the radio button next to the "instrumentation runner" and select the configured instrumentation runner from the drop down. now click on apply and then click on run . i think this will solve your problem.

thanks, smruti


one thing i noticed in this discussion that might be tripping some people up is that you need to make sure the "instrumentation" element in your manifest is a child of "manifest" and not of "application." (the examples here are correct, but this easy to mix up.)

if you put your instrumentation stuff inside application, it won't be picked up, and your choices in the eclipse adt plugin for instrumentation runner may be blank. (but no error is thrown or shown, etc.)


you're probably missing the uses-library and instrumentation nodes in your androidmanifest.xml:

<manifest ...>
    <application ...>
        <!-- ... -->
        <uses-library android:name="android.test.runner" />
    <instrumentation android:name="android.test.instrumentationtestrunner"
        android:label="your tests label" />

Related Query

More Query from same tag