Android Unit Test : Instrumentation failed due to a class error

不打扰是莪最后的温柔 提交于 2019-12-12 02:42:35

问题


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

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

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.


回答1:


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.



来源:https://stackoverflow.com/questions/7760702/android-unit-test-instrumentation-failed-due-to-a-class-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!