Conversion to Dalvik format failed: Unable to execute dex: Multiple dex files are defined

会有一股神秘感。 提交于 2019-12-12 05:25:17

问题


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;"

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.

Any suggestions are greatly appreciated.


回答1:


Looking at the source you provided, the DraggableGridView class is already under src. So adding the jar that contains the same is redundant and dex will complain about duplicate definitions.

To fix it, just remove the DraggableGridView.jar from your project.




回答2:


Project - build Path - Libraries.
Check if android private libraries contains the same jars listed in the libraries in the first place. If so remove private libraries and leave the jars.
That worked for me.




回答3:


Add all the jars in the libs folder externally and uncheck the android private libraries this should work



来源:https://stackoverflow.com/questions/20981447/conversion-to-dalvik-format-failed-unable-to-execute-dex-multiple-dex-files-ar

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!