转换为 Dalvik 格式失败,错误 1
这是我的错误:
UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.IllegalArgumentException: already added: Lorg/codehaus/jackson/Base64Variant;
Conversion to Dalvik format failed with error 1
嗯,5 分钟前它起作用了。没有改变任何东西(只是再次启动了 android 模拟器) - 那么现在发生了什么?
谢谢你们。
here is my error :
UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.IllegalArgumentException: already added: Lorg/codehaus/jackson/Base64Variant;
Conversion to Dalvik format failed with error 1
Well, 5 minutes ago it worked. Didn't change anything (only started the android emulator again) - so what's going on now?
Thanks guys.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您的工具链正在使用 Jackson JSON 解析器的多个副本调用 dx。您需要确保您的项目库不包含 Jackson 的两个副本。您可以使用
jar
和grep
查看单个 jar 文件是否包含 Jackson:Your toolchain is calling
dx
with multiple copies of the Jackson JSON parser. You'll want to make sure your project libraries don't include two copies of Jackson. You can see if an individual jar file contains Jackson withjar
andgrep
:由于我导入的外部 jar,我遇到了同样的错误。事实证明,外部 jar 的每个类都有重复的条目。解决方案是在 ant 构建文件的 jar 元素中使用 duplicate="preserve" 为外部库重新创建 jar 文件(我可以访问完整的外部库的来源)。
如果您无权访问 ant 构建文件,您可以手动解压缩 jar 文件,删除重复项并再次重新 jar。
I got the same error due to an external jar I was importing. It turned out that the external jar had duplicate entries for every class. The solution was to re-create the jar file for the external library with duplicate="preserve" in the jar element in the ant build file (I had access to the full source for the external library).
If you do not have access to the ant build file you can manually un-jar the jar file, remove duplicates and re-jar it again.
我有一个非常类似的问题无法执行 dex:多个 dex 文件使用 Google Drive api 和 Google Spreadsheet api 定义 Lorg/codehaus/jackson/Base64Variant。
尝试了所有常用的 Eclipse 修复方法,清理、重建、启动/停止 Eclipse、新工作区等。
如果您使用 Eclipse,这就是我解决问题的方法,而无需管理 .jar。
1) 在 Eclipse 中,右键单击项目属性
2) 单击“Java 编译器”
3) 单击“构建”
4) 单击“配置工作区设置”
5) 单击“启用项目特定设置”
6) 单击“输出文件夹”
7) 单击“重建修改的类文件”由其他人
希望这有帮助。
I had a very similar problem with Unable to execute dex: Multiple dex files define Lorg/codehaus/jackson/Base64Variant using Google Drive api's and Google Spreadsheet api's.
Tried all the usual Eclipse fix methods, clean, rebuilding, start/stopping Eclipse, new workspace, etc.
If you are using Eclipse, this is how I solved it without having to manage the .jar's.
1) In Eclipse, right click your project properties
2) Click on Java Compiler
3) Click on Building
4) Click on Configure Workspace Settings
5) Click on Enable project specific settings
6) Click on Output Folder
7) Click 'Rebuild class files modified by others'
Hope this helps.