【问题标题】:Eclipse for Java Developers, error in xmlJava 开发人员的 Eclipse,xml 中的错误
【发布时间】:2013-10-29 20:05:16
【问题描述】:

我对 Eclipse 有疑问(适用于 Java 开发人员)。我尝试做一个应用程序,但是当我选择一个 java 文件并单击“运行”时,Eclipse 给了我这个错误。我将我的应用重命名为“AndroidFAQ”。所以,出现了这个问题:

“AndroidFAQ 未指定 android.test.InstrumentationTestRunner 工具或未在其 AndroidManifest.xml 中声明使用库 android.test.runner”。 我尝试了一些解决方案,但他们没有解决它...... 其中之一是这样的: **将以下内容添加到 AndroidManifest.xml -

<instrumentation android:name="android.test.InstrumentationTestRunner" android:targetPackage="..." android:label="..." />
<uses-library android:name="android.test.runner" />**

也许我错了,但这个解决方案并没有解决问题......所以当我写它时,它会出现一个弹出窗口,并在 xml 中出现错误...... 感谢您的回答!

【问题讨论】:

  • 弹出什么错误?

标签: java android xml eclipse


【解决方案1】:

这对我有用。 &lt;uses-library&gt; 必须在 &lt;application&gt; 元素内:

<instrumentation
    android:name="android.test.InstrumentationTestRunner"
    android:targetPackage="com.xxx.xxx" />

<application>
    <uses-library android:name="android.test.runner" />
</application>

【讨论】:

  • 问题是当我写 android:target 和 android:label... 我必须在 xxx 中写什么?
  • 它应该是你正在测试的包的全名。 android:label 在 .
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-03-11
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多