[英]Conversion to Dalvik format failed: Unable to execute dex: Multiple dex files are defined
I'm getting an error at runtime stating: "DraggableGridViewSample] Conversion to Dalvik format failed: Unable to execute dex: Multiple dex files define Lcom/animoto/android/views/DraggableGridView$1;" 我在运行时遇到错误,指出:“ DraggableGridViewSample]转换为Dalvik格式失败:无法执行dex:多个dex文件定义Lcom / animoto / android / views / DraggableGridView $ 1;”
How might this be avoided? 如何避免这种情况? I've tried removing the android-support-v4 jar from my libs folder and clicking Android Tools > Add Android Support Library but I cannot seem to resolve this issue. 我试过从我的libs文件夹中删除android-support-v4 jar并单击Android工具>添加Android支持库,但是我似乎无法解决此问题。
Any suggestions are greatly appreciated. 任何建议,不胜感激。
Looking at the source you provided, the DraggableGridView
class is already under src
. 查看您提供的源代码 , DraggableGridView
类已经在src
下。 So adding the jar that contains the same is redundant and dex will complain about duplicate definitions. 因此,添加包含相同内容的jar是多余的,dex会抱怨重复的定义。
To fix it, just remove the DraggableGridView.jar
from your project. 要修复它,只需从项目中删除DraggableGridView.jar
。
Project - build Path - Libraries. 项目-构建路径-库。
Check if android private libraries contains the same jars listed in the libraries in the first place. 首先检查android私有库是否包含库中列出的相同jar。 If so remove private libraries and leave the jars. 如果是这样,请删除私有库并留下罐子。
That worked for me. 那对我有用。
从外部将所有jars添加到libs文件夹中,然后取消选中应该可用的android私有库
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.