Android“转换为 dalvik 格式失败,错误 1”和proguard

发布于 2024-12-22 01:55:59 字数 174 浏览 5 评论 0原文

导出我的应用程序时,我看到“转换为 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

浅听莫相离 2024-12-29 01:55:59

将您的 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

云归处 2024-12-29 01:55:59

对我来说,问题是包含 proguard.config 作为:

proguard.config=proguard-project.txt

而不是(忘记提及默认的 proguard 配置)

proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt

For me problem was that included proguard.config as:

proguard.config=proguard-project.txt

instead of (forget to mention default proguard config)

proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
只怪假的太真实 2024-12-29 01:55:59

我找到了解决方案。我链接了一个包含 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 :)

我还不会笑 2024-12-29 01:55:59

我正在使用 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.

醉酒的小男人 2024-12-29 01:55:59

我正在使用 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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文