【发布时间】:2025-11-24 17:35:02
【问题描述】:
我正在为我的项目实施多 dex。我能够在实现 multidex 之后编译代码,但是在运行项目时,我在执行 packageAllDebugClassesForMultiDex 任务时遇到下面提到的错误。 错误:任务 ':appname:packageAllDebugClassesForMultiDex' 执行失败。
java.util.zip.ZipException:重复条目:android/support/multidex/MultiDex.class
依赖列表:-
dependencies {
compile project(':slidingMenu')
compile project(':androidPullToRefresh')
compile project(':googlePlayServices')
compile project(':caldroid')
compile files('libs/admsAppLibrary.jar')
compile files('libs/gson-2.3.1.jar')
compile files('libs/jackson-annotations-2.1.1.jar')
compile files('libs/jackson-core-2.1.1.jar')
compile files('libs/jackson-databind-2.1.1.jar')
compile files('libs/jsr305-1.3.9.jar')
compile files('libs/okhttp-2.2.0.jar')
compile files('libs/retrofit-1.9.0.jar')
compile files('libs/xtify-android-sdk-2.4.jar')
compile project(':clusterkraf')
compile files('libs/okio-1.0.0.jar')
compile files('libs/android-support-multidex.jar')
}
下面是我的项目结构。
库 A 包含我的应用程序类。我在其中实现了multidex。 库 B 和库 C 依赖于库 A 我的启动项目 D 依赖于库 B 和库 C。库 D android 清单我已经定义了库 A 中可用的应用程序类。
【问题讨论】:
-
请显示 logcat 以确定错误
-
@Aspicas 没有 logcat 日志,因为它是编译时错误 ...
-
是的,但它总是报告 logcat
-
错误很明显...
android-support-multidex.jar被多次使用...请在询问之前做一些研究 -
@Selvin 我知道错误,但我需要知道哪个库有问题才能给他/她一个好的解决方案。
标签: android android-studio build.gradle android-build android-multidex