简体   繁体   English

转换为Dalvik格式失败:无法执行dex:定义了多个dex文件

[英]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.

相关问题 多个dex文件 - 转换为Dalvik格式失败 - 无法执行dex - Multiple dex files - Conversion to Dalvik format failed - Unable to execute dex 转换为Dalvik格式失败:无法执行dex:多个dex文件定义Lcom / squareup / okhttp / Address; - Conversion to Dalvik format failed: Unable to execute dex: Multiple dex files define Lcom/squareup/okhttp/Address; 无法执行dex和转换为Dalvik格式失败 - Unable to execute dex & Conversion to Dalvik format failed java android Eclipse Retrofit 2.0 转换为 Dalvik 格式失败:无法执行 dex:多个 dex 文件定义了 Lretrofit2/Converter - java android Eclipse retrofit 2.0 Conversion to Dalvik format failed: Unable to execute dex: Multiple dex files define Lretrofit2/Converter 转换为Dalvik格式失败:无法执行dex:Java堆空间 - Conversion to Dalvik format failed: Unable to execute dex: Java heap space 获取错误:转换为Dalvik格式失败:无法执行dex: - Getting Error: conversion to Dalvik format failed: Unable to execute dex: Android:转换为Dalvik格式失败:无法执行dex:null - Android: Conversion to Dalvik format failed: Unable to execute dex: null 类型转换为Dalvik格式失败:无法执行dex:java.nio.BufferOverflowException - Type Conversion to Dalvik format failed: Unable to execute dex: java.nio.BufferOverflowException 无法执行dex:多个dex文件已定义 - Unable to execute dex: Multiple dex files define 无法执行dex:定义了多个dex文件…或NoClassDefFoundError - Unable to execute dex: Multiple dex files define… OR NoClassDefFoundError
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM