ANT Build打包使用生产Dex失败解决方案

1、在JDK7 下面执行会出现问题,因为JDK7并未包含在Android环境之内

The Dalvik virtual machine equivalent of Utils.class was not stored in classes.dex, and an attempt to reference this class (at startup) has resulted in a thrown instance of the Dalvik equivalent of the java.lang.NoClassDefFoundError class. You can further prove this cause to yourself by executing the following command from within the bin directory:


dexdump classes.dex
The classes.dex file contains Android's Dalvik equivalent of the project's compiled Java classfiles. The dexdump tool processes this file and generates a disassembly. Search this disassembly and you'll not find a reference to the Utils class, because this JDK 7-created class is not present.

To fix this problem, include the -source and -target options when compiling the source code via javac, as follows:

javac -source 1.5 -target 1.5 ca/tutortutor/utils/Utils.java
javac -source 1.6 -target 1.6 ca/tutortutor/utils/Utils.java

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值