1

I have a problem with building gradle:

Error:Execution failed for task ':app:dexDebug'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/usr/lib/jvm/java-7-openjdk-i386/bin/java'' finished with non-zero exit value 2

Currently my java version is java version "1.7.0_79". I am trying to run my app on my smartphone with android lollipop.

[EDIT] With oracle jdk I am getting this error:

UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexException: Multiple dex files define Landroid/support/annotation/AnimRes;
    at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:596)
    at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:554)
    at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:535)
    at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:171)
    at com.android.dx.merge.DexMerger.merge(DexMerger.java:189)
    at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:502)
    at com.android.dx.command.dexer.Main.runMonoDex(Main.java:334)
    at com.android.dx.command.dexer.Main.run(Main.java:277)
    at com.android.dx.command.dexer.Main.main(Main.java:245)
    at com.android.dx.command.Main.main(Main.java:106)
Error:Execution failed for task ':app:dexDebug'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/usr/lib/jvm/java-7-oracle/bin/java'' finished with non-zero exit value 2
Information:BUILD FAILED

What could be the reason of this problem and how to solve it?

krzyhub
  • 6,285
  • 11
  • 42
  • 68
  • Try to install the oracle jdk instead of openjdk – SimoV8 Aug 28 '15 at 19:02
  • I believe openjdk is not explicitly supported by android studio – James Wierzba Aug 28 '15 at 19:09
  • Okey, I installed oracle jdk. Is there a place where I should change something more? Any configuration file for a command to use oracle jdk? Because now I am still getting this same error message. – krzyhub Aug 28 '15 at 19:28
  • Unfortunatelly now it returns me similar error: `Error:Execution failed for task ':app:dexDebug'. > com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/usr/lib/jvm/java-7-oracle/bin/java'' finished with non-zero exit value 2` – krzyhub Aug 28 '15 at 20:46
  • After searching this should be my answer: http://stackoverflow.com/questions/18021901/android-studio-gradle-build-fails-execution-failed-for-task-dexdebug – krzyhub Aug 28 '15 at 20:58

0 Answers0