将 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
如果有人遇到过这个问题,请提出建议。这两天我一直被这个问题困扰。
最佳答案
这是我第一次遇到此错误时所做的事情
特定于应用
build.gradle
android {
defaultConfig {
multiDexEnabled true
}
dexOptions {
incremental true
javaMaxHeapSize "4g"
}
}
Application Class
@Override
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
MultiDex.install(base);
}
不要忘记在配置更改后执行干净的构建项目。
关于java - 在 MAC OC 10.9 上升级 android Studio 和 JAVA 后出现问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34604873/