Android Eclipse 插件:未指定 Instrumentation Test Runner [英] Android Eclipse Plugin: Instrumentation Test Runner not specified

查看:13
本文介绍了Android Eclipse 插件:未指定 Instrumentation Test Runner的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试使用 Android 项目从 Eclipse 运行单元测试时遇到此错误.Android 首选项中的 Instrumentation Test Runners 列表为空.

I'm getting this error when trying to run unit tests from Eclipse with an Android Project. The list of Instrumentation Test Runners is empty in the Android preferences.

[2009-06-17 23:57:51 - MyApp] 错误:应用程序没有指定一个android.test.InstrumentationTestRunner仪表或不声明使用库 android.test.runner

[2009-06-17 23:57:51 - MyApp] ERROR: Application does not specify a android.test.InstrumentationTestRunner instrumentation or does not declare uses-library android.test.runner

也很烦人地决定,因为我尝试运行一次单元测试,这就是我一直想做的事情.

It's also annoyingly decided that because I tried to run a unit test once, that's what I always want to do.

推荐答案

Run Configuration 你可能有 Android JUnit Test,如果有任何新的启动配置条目在这个里面,你删除它,然后运行你的应用程序,它会运行.

In the Run Configuration you may have Android JUnit Test, if there are any new launch configuration entries inside this, you delete it and then run your application it will run.

注意 - 如果您在按照 Josef 的回答中所述将正确的行添加到清单之前尝试运行测试用例,这可能是解决方案.如果你已经这样做了,删除配置(它会抱怨没有在它的头中指定检测测试运行器),然后再次将它作为 Android Junit 测试运行,它会创建一个有效的配置,选择正确的东西,你已添加到清单中(请参阅约瑟夫对此的回答).

NOTE - This is likely to be the solution if you tried to run the test case before adding the correct lines to the manifest as described in the answer from Josef. If you have done this, delete the configuration (which will be complaining that no instrumentation test runner has been specified in its header) and then run it as an Android Junit Test again and it will create a valid configuration picking up the correct stuff that you have added to the manifest (see Josef's answer for this).

这篇关于Android Eclipse 插件:未指定 Instrumentation Test Runner的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆