我和Robolectric有一个机器人项目。
我的应用程序相关类放在src/main/java中,测试相关类放在src/test/java中。
我的pom.xml中有以下测试依赖项
<dependency>
<groupId>org.robolectric</groupId>
<artifactId>robolectric</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>使用mvn package android:deploy从控制台构建和部署时,一切正常。从Eclipse (Juno)启动项目时出现问题。
[2013-03-24 12:27:26 - Dex Loader] Unable to execute dex: Multiple dex files define Lorg/apache/maven/artifact/Artifact;
[2013-03-24 12:27:26 - my-app] Conversion to Dalvik format failed: Unable to execute dex: Multiple dex files define Lorg/apache/maven/artifact/Artifact;似乎只包含Robolectric所需的依赖项。我做错了什么?
发布于 2013-04-09 01:52:26
经过调查,它似乎是一个与m2e-android相关的issue
发布于 2013-03-24 18:49:52
在bin/dexedlibs文件夹中有一个重复的jar
发布于 2013-05-24 08:20:26
我曾经遇到过同样的错误。最后,我发现它是由两次包含MoPubView的jar引起的:
- On the one hand, I imported the MoPubView project via Eclipse Menu function "File | Import";
-> then right click my project, select "Properties";
-> In the left bar, select "android";
-> In the "Library" section at the right, press [Add] button...
- On the other hand, I copied the mopub-sdk.jar to the /libs folder of my project. 我删除了后者。问题已经解决了。
https://stackoverflow.com/questions/15597371
复制相似问题