1

Why i am getting following error while testing the application? App1 does not specify a android.test.InstrumentationTestRunner instrumentation or does not declare uses-library android.test.runner in its AndroidManifest.xml

AndroidManifest.xml

<uses-permission android:name="android.permission.INTERNET" />
<application android:icon="@drawable/healthdiary" android:label="@string/app_name">  
     <instrumentation android:name="android.test.InstrumentationTestRunner"
             android:targetPackage="HealthDiary1"
             android:label="@string/app_name" />
      <uses-library android:name="android.test.runner"/>
    <activity android:name=".HealthDiary"
              android:label="@string/app_name">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
2
  • Is this coming when your running your application, or running test project Commented Nov 1, 2011 at 14:09
  • i am getting this error while i am testing my project using Run->Android JUnit Test from main menu of eclipse Commented Nov 1, 2011 at 14:18

6 Answers 6

2

Have you looked at this question?

One of the answers says you are probably missing the following in your manifest.

<instrumentation android:name="android.test.InstrumentationTestRunner"
    android:targetPackage="your.package"
    android:label="your tests label" />

and

<uses-library android:name="android.test.runner" />
Sign up to request clarification or add additional context in comments.

2 Comments

yes i looked at it and also inserted this lines with appropriate changes in my AndroidManifest.xml file. but i am not getting where i am going wrong?
Post your code showing where you have done this, because something is not setup correctly in your manifest.
1

declare all your activities and services in android manifest file

here's the documentation http://developer.android.com/guide/topics/manifest/manifest-intro.html

1 Comment

I know reading the documentation is boring, but it always helps :)
1

For you that like me was searching for a solution and didn't found easily, is that:

Right click on your project name in the Project Explorer (for you who are using Eclipse) and select Run As > Android application.

Just.

Comments

0

Check this Link :

Android Eclipse Plugin: Instrumentation Test Runner not specified

You're probably missing the following in your AndroidManifest.xml:

Hope it helps

2 Comments

After seeing your code, i found that targetpackage i.e., android:targetPackage="HealthDiary1" is wrong because package should be of form "your.package" not a single word right.
Package name must have at least two identifiers like example "com.HealthDiary1", you would have done right while creating application test runner
0

Try run it from

right click -> run as -> android application

It worked for me (my manifest was okay)

Comments

0

Add the following in AndroidManifest.xml:

<instrumentation android:name="android.test.InstrumentationTestRunner"
android:targetPackage="your.package"
android:label="your tests label" />
and
<uses-library android:name="android.test.runner" />

Reference: Android Eclipse Plugin: Instrumentation Test Runner not specified

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.