Caused by: com.android.builder.dexing.DexArchiveBuilderException: Failed to process D:\….\0.jar

first solution:

adds this dependency to android in build.gradle of a project:

compileOptions {
    targetCompatibility JavaVersion.VERSION_1_8
    sourceCompatibility JavaVersion.VERSION_1_8
}

second solution:

add a configuration in the defaultConfig configuration under android in the project’s build.gradle file:

multiDexEnabled true

the third solution is the one I want to share with you most, because this error report I tried a lot of methods, but it still doesn’t work, and finally because the JVM allocation mechanism memory space caused by the compilation error

add this sentence under gradle.properties for the project:

org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8


Read More: