2013-03-24 51 views
1

我有Robolectric的Android项目。无法执行DEX:多DEX文件定义Lorg /阿帕奇/行家/神器/神器

我的应用程序相关的类被放置在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(麦浚龙)项目时会出现 问题。

[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所需的相关性。我究竟做错了什么?

在文件夹仓

回答

2

后它似乎是一个M2E一番调查-Android相关issue

5

/dexedlibs你有一个重复的罐子

  1. 删除
  2. 划清preject
  3. 重试
+0

这是不是这样的。 bin/dexedLibs包含所有依赖关系。即使这些是测试所需的。如maven-project,maven-profile,wagon-file等。我如何让他们离开那里?日蚀中的 – 2013-03-24 12:17:43

+0

,适合我!谢谢! – Pierry 2014-11-12 17:47:58

1

我曾经遇到过同样的错误。最后,我发现它是由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. 

我删除了后者。它解决了。

相关问题