在MAC OC 10.9上升级android Studio和JAVA后出现问题

时间:2016-01-05 05:37:47

标签: java android android-studio

将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

如果有人遇到过这个问题,请提出建议。我在最近两天遇到了这个问题。

1 个答案:

答案 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项目。