【Android 4.0】conversion to dalvik format failed with error 1

本文介绍了解决Android开发中遇到的conversiontodalkvikformatfailedwitherror1问题的方法。主要通过更新Proguard版本来解决此错误,并提供了一个可行的临时解决方案。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

升级SDK Tool r14 和 ADT 15后,在导出签名apk时遇到了这样的问题: conversion to dalvik format failed with error 1。 

(主要原因应该是SDK升级的原因, 单单升级ADT没有遇到问题)


如图:


Refresh、Clean都试过了,还是不行。

最终的解决办法是,去除了project.properties文件(原default.properties)中的proguard配置。

[html]  view plain copy print ?
  1. # This file is automatically generated by Android Tools.  
  2. # Do not modify this file -- YOUR CHANGES WILL BE ERASED!  
  3. #  
  4. # This file must be checked in Version Control Systems.  
  5. #  
  6. # To customize properties used by the Ant build system use,  
  7. # "ant.properties", and override values to adapt the script to your  
  8. # project structure.  
  9.   
  10. # Project target.  
  11. target=android-7  
  12.   
  13. #删除下面这行就ok了  
  14. #proguard.config=proguard.cfg   


上面这种解决方式不太靠谱,毕竟大家还是要混淆代码的,所以说一下另一个解决办法,那就是升级Proguard。
目前最新的proguard是4.7版,我这边升级到Proguard4.6就OK了。



从proguard官网下载4.6的,覆盖到tools/proguad/bin、lib这两个文件夹就OK了.我这边是这样解决的。
下载地址: http://sourceforge.net/projects/proguard/files/proguard/4.6/


如果还有问题的话:

Disable "Build Automatically" on "Project menu" and rebuild it manually (Right click on project -> Build project). Then try export the application again.

Eclipse seems to conflict with export and compile simultaneosly. So every time you need to export an APK, disable automatic build. It's safe to use it any other time.


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值