| 注册
请输入搜索内容

热门搜索

Java Linux MySQL PHP JavaScript Hibernate jQuery Nginx

使用andriod robotium报错,请指导

0
Android Java C/C++ Go 11842 次浏览

写了一个简单的页面,对这个页面使用robotium做测试


 没有报错,但在运行android junit test时出现了错误 


failuer trace具体如下:
java.lang.RuntimeException: Exception during suite construction
at android.test.suitebuilder.TestSuiteBuilder$FailedToCreateTests.testSuiteConstructionFailed(TestSuiteBuilder.java:238)
at java.lang.reflect.Method.invokeNative(Native Method)
at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:191)
at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:176)
at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:554)
at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1701)
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Constructor.constructNative(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at android.test.suitebuilder.TestMethod.instantiateTest(TestMethod.java:87)
at android.test.suitebuilder.TestMethod.createTest(TestMethod.java:73)
at android.test.suitebuilder.TestSuiteBuilder.addTest(TestSuiteBuilder.java:262)
at android.test.suitebuilder.TestSuiteBuilder.build(TestSuiteBuilder.java:184)
at android.test.InstrumentationTestRunner.onCreate(InstrumentationTestRunner.java:379)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4316)
at android.app.ActivityThread.access$1400(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1457)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4998)
at java.lang.reflect.Method.invokeNative(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:777)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:593)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NoClassDefFoundError: com.example.android_listview.MainActivity
at com.example.android_listview.test.android_listview_test.<init>(android_listview_test.java:13)
... 18 more

5个答案

0

这很棒。 我使用类似的调试方法来查找错误。 但是在这里我不能帮助你. 对不起 自由职业者塔玛尔.

0

The change of code or syntax only cannot solve the error problem of the database if you have good code written. Then we must check that which type of server you are using to run oracle software it is very important as per essay service uk sayings. So, the server OS will have a great impact on code running. The malfunction of the server may also cause errors in this software.

0

Thank you for this easy to follow tutorial ! I was thinking to be too stupid to achieve my goal, but in fact i did it ! Yeah ;) Tintin

0

 I truly love how it is easy on my eyes and the data are well written.   free online cribbage

0
Caused by: java.lang.NoClassDefFoundError: com.example.android_listview.MainActivity
at com.example.android_listview.test.android_listview_test.<init>(android_listview_test.java:13).

这个信息已经说明得很清楚了,就是在com.example.android_listview.test.android_listview_test.<init>(android_listview_test.java:13).中没有找到 com.example.android_listview.MainActivity这个类。

仔细看了一下,你是在两个项目中运行测试。你应该把两个项目合并成一个。