Android的单元测试:仪器仪表失败,原因是一类错误 [英] Android Unit Test : Instrumentation failed due to a class error
问题描述
我运行在一个Android模拟器使用Robotium测试。当我运行我的测试,我得到一个错误说测试失败运行到completion.Reason:仪表失败,原因是
I am running a test using Robotium on an android emulator. When I run my test I get an error saying "Test failed to run to completion.Reason: Instrumentation failed due to
com.example.android.businesslogic.TestBL$1
我检查错误的的logcat的,我看到以下
I check the logcat for error's and I see following
W/ActivityManager( 51) com.example.android.businesslogic.TestBL$1
W/ActivityManager( 51) java.lang.NoClassDefFoundError: com.example.android.businesslogic.TestBL$1
我的应用程序没有任何错误,都可以流畅运行,它只是当我做单元测试,我得到这个。任何帮助深表AP preciated。
My application has no error and can run smoothly, its just when I do the unit test that I get into this. Any help is deeply appreciated.
推荐答案
删除以及适当的类路径和路径的apk再次创建测试项目。你只需要创建一个测试项目,包括任何外部JAR的,如果你有。这为我工作。
Delete and Create the test project again with proper class paths and the path to apk. You just have to create a test project and include any external Jar's if you have. This worked for me.
这篇关于Android的单元测试:仪器仪表失败,原因是一类错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!