ERROR: Application does not specify a android.test.InstrumentationTestRunner instrumentation or does not declare uses-library android.test.runner是需要支持TestCase的jar包么??

解决方案 »

  1.   

    就是点击Junit测试的时候直接弹出对话框,
      

  2.   

    需要建立一个测试工程,并且测试工程要对你所要测试的工程进行引用 ,并在测试工程的AndroidManifest.xml中的内容如下:
    <?xml version="1.0" encoding="utf-8"?>
    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
          package="com.test.test"
          android:versionCode="1"
          android:versionName="1.0">    <instrumentation android:targetPackage="com.test" android:name="android.test.InstrumentationTestRunner" />
        <application android:icon="@drawable/icon" android:label="@string/app_name">    <uses-library android:name="android.test.runner" />
        </application>
    </manifest>注意一定要添加  <instrumentation android:targetPackage="com.test" android:name="android.test.InstrumentationTestRunner" />
    其中targetPacket是你所要测试工程的包名;
    和<uses-library android:name="android.test.runner" />希望对你有帮助