将Android Studio升级到2.0预览版4后,我无法构建现有的应用程序。它存在以下错误:
1/ In android studio Preferences it is still showing JRE version 1.6, Although i have updated Java as well
2/ Execution failed for task ':docSink:transformClassesWithDexForDebug'., for this i have enabled MultiDex in my build.gradle file, still having issue.
3/ com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Library/Java/JavaVirtualMachines/jdk1.8.0_05.jdk/Contents/Home/bin/java'' finished with non-zero exit value 3
如果有人遇到过这个问题,请提出建议。我在最近两天遇到了这个问题。
答案 0 :(得分:1)
这是我第一次面对这个错误时所做的事情
特定于应用程序
的build.gradle
android {
defaultConfig {
multiDexEnabled true
}
dexOptions {
incremental true
javaMaxHeapSize "4g"
}
}
申请类
@Override
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
MultiDex.install(base);
}
在配置更改后,不要忘记执行clean build项目。