您的位置:首页 > 产品设计 > UI/UE

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

2014-05-27 15:29 507 查看
废话不说,一直报错。网上介绍的都是缺少如下声明之类。

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

<?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" >

<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" >

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

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

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

</application>

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

</manifest>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐