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

StackOverflow https://stackoverflow.com/questions/20981447

سؤال

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.

enter image description here

هل كانت مفيدة؟

المحلول

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.

نصائح أخرى

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.

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

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top