Android 下进行单元测试 Test run failed:Instrumentation run failed due to 'java.lang.ClassNotFoundException'

废话不说,一直报错。网上介绍的都是缺乏以下声明之类。java

但注意的是工程配置是导出junit包, 路径为  project上右键 --> properties -> java build path --> order and export --> 选中 junit -->从新编译测试android

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="hp.smpf.formddx"
android:versionCode="1"
android:versionName="1.0" >app

<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="18" />测试

<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
ui

<activity
android:name="hp.smpf.formddx.MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />spa

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

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

</application>orm

<instrumentation
android:name="android.test.InstrumentationTestRunner"
android:targetPackage="hp.smpf.formddx" />xml

</manifest>utf-8

相关文章
相关标签/搜索