0

I am experimenting with the new android studio IDE 2.0 , Project was working fine with studio 1.5 . After Migration I am geeting the following Error-

:app:transformClassesWithDexForDebug FAILED

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':app:transformClassesWithDexForDebug'.

    com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Users/manishpathak/AndroidStudioProjects/jdk1.7.0_80.jdk/Contents/Home/bin/java'' finished with non-zero exit value 3 ' BUILD FAILED

Already enabled

   multiDexEnabled true

in build.gradle.

Did anyone face this issue?

MANISH PATHAK
  • 2,602
  • 4
  • 27
  • 31

2 Answers2

2

Thanks All. The following solution fixed my issue- Java wanted more space to build the project. I found the java process and analysed after 1 GB, process halted. Java needs more memory.

FIXED SOLUTION: Increased the HEAP size to 2g or 4g.

android {
    defaultConfig {}

    dexOptions {
        javaMaxHeapSize "4g"
    }

    packagingOptions {
    }

    buildTypes {
    } }
MANISH PATHAK
  • 2,602
  • 4
  • 27
  • 31
  • Cannot resolve symbol 'javaMaxHeapSize'. Probably does not work the latest build tools/gradle – ivy_the Mar 06 '16 at 13:28
  • @ivy_the you might misplaced the `dexoption`, put it as a child of android in your module (located build.gradle in app dir ) gradle file. let me know if you still facing the issue. – MANISH PATHAK Mar 08 '16 at 11:42
  • you are right, I should have put it in android section – ivy_the Mar 09 '16 at 17:24
0

i just added this ,and then its all ok and my issue was solved :

/* compile 'com.android.support:support-v4:19.1.0' */
Nehal
  • 1,542
  • 4
  • 17
  • 30