gpt4 book ai didi

android - com.android.dex.DexException : Multiple dex files define

转载 作者:IT老高 更新时间:2023-10-28 21:59:23 32 4
gpt4 key购买 nike

我使用的是 Android Studio 0.4.2。从使用 0.3.2 的 friend 那里打开的项目。试图编译但出现异常。

Execution failed for task ':JuiceTV:dexDebug'.
> com.android.ide.common.internal.LoggedErrorException: Failed to run command:
C:\Program Files\Android\android-studio\sdk\build-tools\19.0.0\dx.bat --dex --output D:\Antik TV - Android\JuiceTV\build\libs\JuiceTV-debug.dex D:\Antik TV - Android\JuiceTV\build\classes\debug D:\Antik TV - Android\JuiceTV\build\dependency-cache\debug D:\Antik TV - Android\JuiceTV\build\pre-dexed\debug\classes-ffe9228b675e120536184b1056a59fcfc91e4006.jar D:\Antik TV - Android\JuiceTV\build\pre-dexed\debug\commons-io-2.4-27f1277ba9e42db4b52f3f658da01a26db29b896.jar D:\Antik TV - Android\JuiceTV\build\pre-dexed\debug\joda-time-2.2-4549e2440d188ee3fb4f85702e03eace13e8ad18.jar D:\Antik TV - Android\JuiceTV\build\pre-dexed\debug\mmlib-04a4fd100008bfbc84f0c25fd219e50eb7de9d0b.jar D:\Antik TV - Android\JuiceTV\build\pre-dexed\debug\support-v4-18.0.0-ba816fc3ae00ee0fdb20e5444c1d8bb88647d773.jar
Error Code:
2
Output:
UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexException: Multiple dex files define Lcom/sevensoft/mmlib/AttachedOverlayWindow$1;
at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:593)
at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:551)
at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:532)
at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:169)
at com.android.dx.merge.DexMerger.merge(DexMerger.java:187)
at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:439)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:287)
at com.android.dx.command.dexer.Main.run(Main.java:230)
at com.android.dx.command.dexer.Main.main(Main.java:199)
at com.android.dx.command.Main.main(Main.java:103)

试过这个东西:

  • 删除 *.apk 文件
  • 使用 gradle -q dependencies 搜索依赖项但一无所获

JuiceTV Gradle:

buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.7.+'
}
}
apply plugin: 'android'

repositories {
mavenCentral()
}

android {
compileSdkVersion 18
buildToolsVersion "19.0.0"

defaultConfig {
minSdkVersion 14
targetSdkVersion 18
}
}

dependencies {
compile project(':TVbase')
}

BaseTv Gradle:

buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.7.+'
}
}
apply plugin: 'android-library'

repositories {
mavenCentral()
}

android {
compileSdkVersion 18
buildToolsVersion '19.0.0'

defaultConfig {
minSdkVersion 14
targetSdkVersion 18
}
}

dependencies {
compile 'com.android.support:support-v4:18.0.+'
compile files('libs/joda-time-2.2.jar')
compile files('libs/mmlib.jar')
compile files('libs/commons-io-2.4.jar')
}

有什么新的提示吗?

最佳答案

我刚刚遇到了同样的问题,我发现我的应用程序和一个库引用了同一个 jar 的 2 个版本。

我进行了搜索,我的 application.iml 文件清楚地显示了重复项。

<orderEntry type="library" exported="" name="crittercism_v3_0_11_sdkonly" level="project" />
<orderEntry type="library" exported="" name="crittercism_v4_4_0" level="project" />

我用 v4 版本替换了旧的 v3 版本,并且在干净重建后它可以工作。

关于android - com.android.dex.DexException : Multiple dex files define,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21735493/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com