在Eclipse中的Android应用程序中,我得到了以下错误。
意想不到的顶级异常: java.lang.IllegalArgumentException:已添加:Lorg/xmlpull/v1/XmlPullParser; .... 转换到Dalvik格式失败,错误1
此错误仅在向项目添加特定的外部JAR文件时出现。我花了很长时间寻找可能的解决方案,但没有一个可行。
我甚至尝试将Android 1.6而不是1.5(我目前使用的版本)。
在Eclipse中的Android应用程序中,我得到了以下错误。
意想不到的顶级异常: java.lang.IllegalArgumentException:已添加:Lorg/xmlpull/v1/XmlPullParser; .... 转换到Dalvik格式失败,错误1
此错误仅在向项目添加特定的外部JAR文件时出现。我花了很长时间寻找可能的解决方案,但没有一个可行。
我甚至尝试将Android 1.6而不是1.5(我目前使用的版本)。
当前回答
如果你在应用中使用Leadbolt广告SDK,并将“通知广告”和“显示广告”结合在一起,你需要使用pubxappCom.jar而不是pubxapp.jar来发布通知广告,否则你就会出现这个错误!
编码快乐!
其他回答
依赖项上的谷歌API会导致此问题。拆卸后工作良好。
以上所有的解决方案都不适合我。我没有使用任何预编译的.jar。我使用的是LVL和Dalvik错误,所有这些都与市场许可库有关。
这个问题通过删除主项目并重新导入(从现有的资源中创建一个新项目)得到了解决。
每次出现这种错误时,简单地清理项目对我来说都很有效。
上面列出的解决方案没有一个对我有效。
这就是我遇到的问题:
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!
此错误是由于
拥有多个JAR文件。 如果JAR文件具有类似的类文件,则不能解析.dx格式。
解决方案:
制作并选择适当的JAR文件。 买最新的。