title: MainDexClassList build error Android
body: <p>I have an android project that passed the 65K method limit. I enabled multidex in the build.gradle and then made my main application file that extended Application to extend MultiDexApplication. I also overrode the attachBaseContext method appropriately.I now get the following error when generating a signed APK.</p>
  
  <pre><code>13:24:42.945 [ERROR] [org.gradle.BuildExceptionReporter] 
  13:24:42.946 [ERROR] [org.gradle.BuildExceptionReporter] FAILURE: Build failed with an exception.
  13:24:42.946 [ERROR] [org.gradle.BuildExceptionReporter] 
  13:24:42.946 [ERROR] [org.gradle.BuildExceptionReporter] * What went wrong:
  13:24:42.946 [ERROR] [org.gradle.BuildExceptionReporter] Execution failed for task ':projectName:createprojectNameReleaseMainDexClassList'.
  13:24:42.946 [ERROR] [org.gradle.BuildExceptionReporter] &gt; com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/usr/java/bin/java'' finished with non-zero exit value 1
  13:24:42.946 [ERROR] [org.gradle.BuildExceptionReporter] 
  13:24:42.946 [ERROR] [org.gradle.BuildExceptionReporter] * Exception is:
  13:24:42.946 [ERROR] [org.gradle.BuildExceptionReporter] org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':projectName:createprojectNameReleaseMainDexClassList'.
  13:24:42.947 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69)
  13:24:42.947 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
  13:24:42.947 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35)
  13:24:42.947 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:64)
  13:24:42.947 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
  13:24:42.947 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:42)
  13:24:42.947 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
  13:24:42.947 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53)
  13:24:42.947 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
  13:24:42.948 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.AbstractTask.executeWithoutThrowingTaskFailure(AbstractTask.java:305)
  13:24:42.948 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.executeTask(AbstractTaskPlanExecutor.java:79)
  13:24:42.948 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:63)
  13:24:42.948 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:51)
  13:24:42.948 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.internal.concurrent.DefaultExecutorFactory$StoppableExecutorImpl$1.run(DefaultExecutorFactory.java:64)
  13:24:42.948 [ERROR] [org.gradle.BuildExceptionReporter] Caused by: org.gradle.internal.UncheckedException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/usr/java/bin/java'' finished with non-zero exit value 1
  13:24:42.948 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.internal.UncheckedException.throwAsUncheckedException(UncheckedException.java:39)
  13:24:42.948 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:66)
  13:24:42.948 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.doExecute(AnnotationProcessingTaskFactory.java:218)
  13:24:42.949 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:211)
  13:24:42.949 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:200)
  13:24:42.949 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:579)
  13:24:42.949 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:562)
  13:24:42.949 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
  13:24:42.949 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
  13:24:42.949 [ERROR] [org.gradle.BuildExceptionReporter]    ... 13 more
  13:24:42.949 [ERROR] [org.gradle.BuildExceptionReporter] Caused by: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/usr/java/bin/java'' finished with non-zero exit value 1
  13:24:42.949 [ERROR] [org.gradle.BuildExceptionReporter]    at com.android.build.gradle.internal.process.GradleProcessResult.assertNormalExitValue(GradleProcessResult.java:42)
  13:24:42.949 [ERROR] [org.gradle.BuildExceptionReporter]    at com.android.builder.core.AndroidBuilder.createMainDexList(AndroidBuilder.java:1217)
  13:24:42.950 [ERROR] [org.gradle.BuildExceptionReporter]    at com.android.builder.core.AndroidBuilder$createMainDexList$3.call(Unknown Source)
  13:24:42.950 [ERROR] [org.gradle.BuildExceptionReporter]    at com.android.build.gradle.internal.tasks.multidex.CreateMainDexList.callDx(CreateMainDexList.groovy:93)
  13:24:42.950 [ERROR] [org.gradle.BuildExceptionReporter]    at com.android.build.gradle.internal.tasks.multidex.CreateMainDexList.this$5$callDx(CreateMainDexList.groovy)
  13:24:42.950 [ERROR] [org.gradle.BuildExceptionReporter]    at com.android.build.gradle.internal.tasks.multidex.CreateMainDexList$this$5$callDx.callCurrent(Unknown Source)
  13:24:42.950 [ERROR] [org.gradle.BuildExceptionReporter]    at com.android.build.gradle.internal.tasks.multidex.CreateMainDexList.output(CreateMainDexList.groovy:64)
  13:24:42.950 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:63)
  13:24:42.950 [ERROR] [org.gradle.BuildExceptionReporter]    ... 20 more
  13:24:42.950 [ERROR] [org.gradle.BuildExceptionReporter] Caused by: org.gradle.process.internal.ExecException: Process 'command '/usr/java/bin/java'' finished with non-zero exit value 1
  13:24:42.950 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.process.internal.DefaultExecHandle$ExecResultImpl.assertNormalExitValue(DefaultExecHandle.java:365)
  13:24:42.951 [ERROR] [org.gradle.BuildExceptionReporter]    at com.android.build.gradle.internal.process.GradleProcessResult.assertNormalExitValue(GradleProcessResult.java:40)
  13:24:42.951 [ERROR] [org.gradle.BuildExceptionReporter]    ... 27 more
  13:24:42.951 [ERROR] [org.gradle.BuildExceptionReporter] 
  </code></pre>
  
  <p>What can I do to get past this error?</p>