1

我正在尝试通过 maven 在 intelli-j idea 中将 Robotium 测试添加到我的 android 项目中。当我尝试编译它时,它只会给出以下错误

Android Dex: [robotium] trouble processing "javax/xml/parsers/DocumentBuilder.class":
Android Dex: [robotium] Ill-advised or mistaken usage of a core class (java.* or javax.*)
Android Dex: [robotium] when not building a core library.
Android Dex: [robotium] This is often due to inadvertently including a core library file
Android Dex: [robotium] in your application's project, when using an IDE (such as
Android Dex: [robotium] Eclipse). If you are sure you're not intentionally defining a
Android Dex: [robotium] core class, then this is the most likely explanation of what's
Android Dex: [robotium] going on.
Android Dex: [robotium] However, you might actually be trying to define a class in a core
Android Dex: [robotium] namespace, the source of which you may have taken, for example,
Android Dex: [robotium] from a non-Android virtual machine project. This will most
Android Dex: [robotium] assuredly not work. At a minimum, it jeopardizes the
...

我试图解决的事情

1) 通过 maven 将 Robotium 添加到一个空项目和一个示例 Robotium 应用程序。没有变化。

2)在“项目结构”下,我尝试更改 Robotium 库的范围。我可以让它以这种方式编译,但最终出现 NoClassDefFoundError 错误。不是我想要的。

3) 尝试使用以前版本的 Robotium - 没有变化。

4)搜索谷歌我遇到了这个:

Nov 14 01:32:50 <xastey> I asked this ealier but got sidetrack with other work so ....
 I'm getting "trouble processing "javax/xml/parsers/DocumentBuilder.class" " while
trying to compile my project.. anyone ran into this problem?
        ...

Nov 14 01:37:01 <xastey> nvm.. had to remove com.google.android:android dependency

从 com.jayway.android.robotium:robotium-solo:4.3 查看 maven 类,它确实导入

android-4.0.1.2.jar

现在很自然地,我的项目中已经包含了 android 平台。这可能是问题吗?android平台包含两次?这似乎也表明支持这一假设Android 4.0 Eclipse 编译失败

如果是这样,我该如何解决?似乎没有办法在 IDE 中编辑 Maven 导入的 jar。我必须手动编辑 pom 文件吗?我只将 IDE 用于依赖项,因此除此之外我几乎没有任何知识/经验。

当然,也许我在这里完全走错了路。任何建议/输入将不胜感激。

4

0 回答 0