android maven Unable to execute dex: Multiple dex files define


环境:开发 android

eclipse + maven


在使用 maven 开发 android 中

<dependencies>

		<dependency>
			<groupId>net.lingala.zip4j</groupId>
			<artifactId>zip4j</artifactId>
			<version>1.3.2</version>
		</dependency>
		<dependency>
			<groupId>org.apache.httpcomponents</groupId>
			<artifactId>httpmime</artifactId>
			<version>4.4-beta1</version>

		</dependency>

		<dependency>
			<groupId>org.apache.httpcomponents</groupId>
			<artifactId>httpcore</artifactId>
			<version>4.4-beta1</version>
		</dependency>

		<dependency>
			<groupId>commons-codec</groupId>
			<artifactId>commons-codec</artifactId>
			<version>1.10</version>
		</dependency>

		<dependency>
			<groupId>com.alibaba</groupId>
			<artifactId>fastjson</artifactId>
			<version>1.2.3</version>
		</dependency>
	</dependencies>

编译中出现 

           Unable to execute dex: Multiple dex files define Lorg/apache/commons/logging/Log;

          Conversion to Dalvik format failed: Unable to execute dex: Multiple dex files define Lorg/apache/commons/logging/Log;


在android  更目录中  使用   mvn dependency:tree

[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for DefinitiveGuide:DefinitiveGuide:apk:0.0.1-SNAPSHOT
[WARNING] 'build.plugins.plugin.version' for com.jayway.maven.plugins.android.generation2:maven-android-plugin is missing. @ line 55, column 12
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. @ line 47, column 12
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building DefinitiveGuide 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ DefinitiveGuide ---
[INFO] DefinitiveGuide:DefinitiveGuide:apk:0.0.1-SNAPSHOT
[INFO] +- net.lingala.zip4j:zip4j:jar:1.3.2:compile
[INFO] +- org.apache.httpcomponents:httpmime:jar:4.4-beta1:compile
[INFO] |  \- org.apache.httpcomponents:httpclient:jar:4.4-beta1:compile
[INFO] |     \- commons-logging:commons-logging:jar:1.1.3:compile
[INFO] +- org.apache.httpcomponents:httpcore:jar:4.4-beta1:compile
[INFO] +- commons-codec:commons-codec:jar:1.10:compile
[INFO] \- com.alibaba:fastjson:jar:1.2.3:compile
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.021 s
[INFO] Finished at: 2015-01-10T13:12:11+08:00
[INFO] Final Memory: 19M/219M
[INFO] ------------------------------------------------------------------------

修改 pom.xml 文件


<dependencies>
		<dependency>
			<groupId>net.lingala.zip4j</groupId>
			<artifactId>zip4j</artifactId>
			<version>1.3.2</version>
		</dependency>
		<dependency>
			<groupId>org.apache.httpcomponents</groupId>
			<artifactId>httpmime</artifactId>
			<version>4.4-beta1</version>
			<span style="color:#FF6666;"><!-- 去掉重复 jar 包 -->
			<exclusions>
				<exclusion>
					<artifactId>commons-logging</artifactId>
					<groupId>commons-logging</groupId>
				</exclusion>
			</exclusions></span>
		</dependency>

		<dependency>
			<groupId>org.apache.httpcomponents</groupId>
			<artifactId>httpcore</artifactId>
			<version>4.4-beta1</version>
		</dependency>

		<dependency>
			<groupId>commons-codec</groupId>
			<artifactId>commons-codec</artifactId>
			<version>1.10</version>
		</dependency>

		<dependency>
			<groupId>com.alibaba</groupId>
			<artifactId>fastjson</artifactId>
			<version>1.2.3</version>
		</dependency>
	</dependencies>




编译顺利完成。运行也OK。





  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值