Android“转换为 dalvik 格式失败,错误 1”和proguard
导出我的应用程序时,我看到“转换为 dalvik 格式失败,错误 1”,但我在控制台输出中没有看到任何内容来帮助我解决它。
我已重新启动 eclipse 并检查控制台,但我没有看到任何内容?
proguard 日志存储在哪里?
在没有 proguard 的情况下运行应用程序时一切正常
I am seeing 'Conversion to dalvik format failed with error 1' when exporting my app but I dont see anything in the console output to help me resolve it
I have restarted eclipse and checked the console and I dont see anything?
Where do the proguard logs get stored?
When running the app without proguard all works fine
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
将您的 proguard 版本更新到最新版本:
http://proguard.sourceforge.net/
Update your version of proguard to the latest version:
http://proguard.sourceforge.net/
转到项目 » 属性 » Java 构建路径 » 库并删除除“Android XY”(在我的例子中为 Android 1.5)之外的所有内容。单击“确定”。转到项目 » 清理 » 清理下面选择的项目 » 选择您的项目,然后单击确定。那应该有效。
也有可能您的项目文件夹中某个位置有一个 JAR 文件(我已将 Admob jar 复制到我的 src forlder 中),然后将其添加为 Java 路径库。它不会显示在 Package Explorer 下,因此您不会注意到它,但它确实会被计数两次,从而导致可怕的 Dalvik 错误 1。
答案位于 这个问题
Go to Project » Properties » Java Build Path » Libraries and remove all except the "Android X.Y" (in my case Android 1.5). click OK. Go to Project » Clean » Clean projects selected below » select your project and click OK. That should work.
It is also possible that you have a JAR file located somewhere in your project folders (I had copied the Admob jar into my src forlder) and THEN added it as a Java Path Library. It does not show up under the Package Explorer, so you don't notice it, but it does get counted twice, causing the dreaded Dalvik error 1.
Answer was found in this question
对我来说,问题是包含
proguard.config
作为:而不是(忘记提及默认的 proguard 配置)
For me problem was that included
proguard.config
as:instead of (forget to mention default proguard config)
我找到了解决方案。我链接了一个包含 android-support jar 文件的库,甚至引用项目也有一个 android-support jar 文件。最初我重命名但仍然无效。由于我添加的库文件中已经有一个 android-support jar 文件,因此我删除了引用项目中存在的 android-support jar 文件,因此问题得到了解决:)
I found a solution. I had linked a library which had android-support jar file and even the referencing project had an android-support jar file. initially i renamed but still dint work. Since there was already an android-support jar file from the library file that i added, i deleted the android-support jar file present in the referencing project and hence the issue was solved :)
我正在使用 Pro-Guard。经过所有检查导入的.jar文件后,清理和重建错误仍然发生。但我找到了另一种方法来摆脱这个困境并成功导出签名的包。这是通过删除项目文件夹中的 bin 和 gen 文件夹来实现的。返回 eclipse 并清理您的项目。
希望这有帮助。
I am using Pro-Guard. After all the checking imported .jar files, cleaning and rebuilds the error still occur. But I found another way to get out from this and successfully export signed package. This is through deleting bin and gen folder in you project folder. Go back to eclipse and clean your project.
Hope this helps.
我正在使用 Eclispe IDE,并且在导出签名应用程序期间遇到了同样的问题。
我更改了 proguard.cfg 以避免优化(-dontoptimize),一切都很顺利
I am using Eclispe IDE and I faced the same issue during Export Signed app.
I changed in the proguard.cfg to avoid optimization (-dontoptimize) and everything is going smoothly