gpt4 book ai didi

android - 将字节码转换为 dex 时出错 : DexException: Library dex files are not supported in multi-dex mode

转载 作者:行者123 更新时间:2023-12-03 05:13:30 27 4
gpt4 key购买 nike

我试图在 avd 中运行我的应用程序,但是当我选择运行 gradle 时出现异常:

Error:Error converting bytecode to dex:
Cause: com.android.dex.DexException: Library dex files are not supported in multi-dex mode
:app:transformClassesWithDexForDebug FAILED
Error:Execution failed for task ':app:transformClassesWithDexForDebug'.
> com.android.build.api.transform.TransformException: java.lang.RuntimeException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.8.0_66\bin\java.exe'' finished with non-zero exit value 2

当我同步它但在运行时,我的应用程序已成功同步!
这是我的毕业生:
apply plugin: 'com.android.application'

android {
compileSdkVersion 23
buildToolsVersion "23.0.1"

defaultConfig {
applicationId "ir.esfandune.material"
minSdkVersion 9
targetSdkVersion 23
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dexOptions {
incremental true
preDexLibraries = false
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
}

repositories {
jcenter()
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }

}

dependencies {
compile 'com.android.support:multidex:1.0.1'
compile 'com.android.support:design:23.0.0'
compile 'com.android.support:appcompat-v7:23.0.0'
compile 'com.android.support:cardview-v7:23.0.0'
compile 'com.android.support:recyclerview-v7:23.0.0'
compile 'com.android.support:support-v4:23.0.0'
compile 'com.github.rey5137:material:1.2.1.6-SNAPSHOT'
compile project(':material-dialogs')
compile files('lib/glide-3.6.1- 3f8a822297969bbac00507aeca83271794f037ca.jar')
//compile files('lib/de.hdodenhof/circleimageview/1.3.0/jars/classes.jar')
}

这是我的另一个模块 gradle 文件:
apply plugin: 'com.android.application'

android {
compileSdkVersion 23
buildToolsVersion "23.0.1"

defaultConfig {
applicationId "ir.esfandune.material"
minSdkVersion 9
targetSdkVersion 23
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dexOptions {
incremental true
preDexLibraries = false
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
}

repositories {
jcenter()
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }

}

dependencies {
compile 'com.android.support:multidex:1.0.1'
compile 'com.android.support:design:23.0.0'
compile 'com.android.support:appcompat-v7:23.0.0'
compile 'com.android.support:cardview-v7:23.0.0'
compile 'com.android.support:recyclerview-v7:23.0.0'
compile 'com.android.support:support-v4:23.0.0'
compile 'com.github.rey5137:material:1.2.1.6-SNAPSHOT'
compile project(':material-dialogs')
compile files('lib/glide-3.6.1-3f8a822297969bbac00507aeca83271794f037ca.jar')

}

我在stackoverflow和google上搜索修复这个错误,但没有找到任何有用的答案!
有人可以帮助我吗?

最佳答案

  • 检查您使用的所有库,包括库的依赖项,并确保没有冲突的版本。
  • 从 Android Stodio 打开终端并输入:“./gradlew clean”
  • 再次构建
  • 关于android - 将字节码转换为 dex 时出错 : DexException: Library dex files are not supported in multi-dex mode,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38550028/

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