1. 程式人生 > >Error:Execution failed for task ':app:transformClassesWithDexForDebug'

Error:Execution failed for task ':app:transformClassesWithDexForDebug'

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 –multi-dex –main-dex-list E:\myProject\QLJSProject\BJ-RuralSewageTreatment

在app的gradler配置檔案中,新增 multiDexEnabled true 開啟分包,然後新增

dexOptions {
    javaMaxHeapSize "4g"
}

**
defaultConfig {
applicationId “xxxxxx”
minSdkVersion 17
targetSdkVersion 22
versionCode 1
versionName “1.0”
multiDexEnabled true
}
dexOptions {
javaMaxHeapSize “4g”
}