Android单元测试:由于类错误导致Instrumentation失败

时间:2011-10-13 21:36:07

标签: java android robotium

我在Android模拟器上使用Robotium运行测试。当我运行我的测试时,我得到一个错误,说“测试未能运行到完成。原因:仪器因

而失败
 com.example.android.businesslogic.TestBL$1

我检查logcat是否有错误,我看到了

 W/ActivityManager( 51) com.example.android.businesslogic.TestBL$1
 W/ActivityManager( 51) java.lang.NoClassDefFoundError: com.example.android.businesslogic.TestBL$1

我的应用程序没有错误,可以顺利运行,就在我进行单元测试的时候。非常感谢任何帮助。

1 个答案:

答案 0 :(得分:1)

使用适当的类路径和apk的路径再次删除并创建测试项目。您只需创建一个测试项目并包含任何外部Jar(如果有)。这对我有用。