如何解决将字节码转换为dex的错误?

时间:2017-10-09 07:22:32

标签: java android

当我在Android工作室中按下F5运行应用程序时,我看到错误,你可以在这个链接上看到错误![截图错误] [1] 我该如何解决?

摇篮:

apply plugin: 'com.android.application'

android {
compileSdkVersion 26
buildToolsVersion '26.0.2'
defaultConfig {
   ...       
}
...

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')

compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.android.volley:volley:1.0.0'
compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha7'
compile 'ir.adad.androidsdkv3:AdadSDKv3:3.3.1'
compile 'com.android.support:appcompat-v7:26.0.0-alpha1'
compile 'com.android.support:recyclerview-v7:26.0.0-alpha1'
compile 'com.android.support:design:26.0.0-alpha1'
}
apply plugin: 'com.google.gms.google-services'

错误

Error:Execution failed for task ':app:transformClassesWithDexForDebug'.
> com.android.build.api.transform.TransformException: 
com.android.ide.common.process.ProcessException: 
java.util.concurrent.ExecutionException: 
com.android.ide.common.process.ProcessException: Error while executing java 
process with main class com.android.dx.command.Main with arguments {--dex --
num-threads=4 --output

1 个答案:

答案 0 :(得分:1)

在app.gradle中启用Multidex

android {
    defaultConfig {
        multiDexEnabled true
    }    
}