在Eclipse中的Android应用程序中,我得到了以下错误。

意想不到的顶级异常: java.lang.IllegalArgumentException:已添加:Lorg/xmlpull/v1/XmlPullParser; .... 转换到Dalvik格式失败,错误1

此错误仅在向项目添加特定的外部JAR文件时出现。我花了很长时间寻找可能的解决方案,但没有一个可行。

我甚至尝试将Android 1.6而不是1.5(我目前使用的版本)。


当前回答

更新Proguard到最新版本为我解决了这个问题。

我的proguard路径是C:\Program Files (x86)\Android\ android-sdk\tools\proguard\ 我从这里下载了新版本 并替换了bin和lib文件夹

感谢上帝!

其他回答

这个错误是由于我从构建路径中排除的几个文件被删除了,但没有从排除列表中删除。

项目->属性-> Java Build Path -> Source选项卡->项目/src文件夹->双击排除->删除项目中不再存在的任何文件。

我遍历了这个答案中的步骤,仍然没有得到解决方案。我一直在网上搜索,发现如果你试图在Android设备连接到计算机时导出APK,就会得到这个错误。

断开我的设备,然后关闭项目,重新启动计算机,打开项目,然后清理它,这三次都发生了。

通常对我来说,清理项目并不能解决这个问题。

但是在Eclipse中关闭项目,然后重新打开它似乎可以修复这些情况……

如果你有ADT版本12+,你应该更新你的防护从4.4 -> 4.6(如这里所述)。此外,您应该以原始形式保留…\bin\proguard.bat文件。

只需从网上下载它,并复制lib文件夹从下载包到:

[Android SDK安装目录]\tools\proguard\lib

上面列出的解决方案没有一个对我有效。

这就是我遇到的问题:

I added the jSoup external JAR file to my project's path by first putting it in a source folder called "libs", and then right clicking on it, Build Path -> add to build path. This threw the Dalvik conversion error. It said I had "already included" a class from that JAR file. I looked around the project's directory and found that the place where it was "already included" was in fact the bin directory. I deleted the JAR file from the bin directory and refreshed the project in Eclipse and the error went away!