2

Error:Execution failed for task ':app:dexDebug'.

com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.7.0_79\bin\java.exe'' finished with non-zero exit value 1

I am new to Android development.

I got above error when I tried to run sample code - http://examples.javacodegeeks.com/android/android-barcode-and-qr-scanner-example/

I cleaned and rebuild the project too, then the error goes away but when i try to run again (to run in emulator), then error reoccurs. Any suggestions?

Many thanks in advance.

Dep
  • 183
  • 1
  • 3
  • 14
  • have you checked these links: http://stackoverflow.com/questions/30410140/android-studio-java-exe-is-finished-with-non-zero-exit-value-2 and http://stackoverflow.com/questions/31297062/gradle-build-failed-java-exe-is-finished-with-non-zero-exit-value-2 – Developer Dec 15 '15 at 07:49
  • can you compile any Java program with the above mentioned Java version(1.7.0_79)? – pri Dec 15 '15 at 07:49
  • try this http://stackoverflow.com/questions/29045129/android-java-exe-finished-with-non-zero-exit-value-1 – Nabeel K Dec 15 '15 at 07:51
  • This type of question already asked – IntelliJ Amiya Dec 15 '15 at 07:54
  • Yes, I saw many similar threats, but could not solve my issue – Dep Dec 15 '15 at 07:58
  • one of the solution was to use: defaultConfig { // Enabling multidex support. multiDexEnabled true } but I am not sure - where to insert?? sorry to ask a naive question – Dep Dec 15 '15 at 07:58
  • Priyank, I am able to, just that when I try to run in emulator - error occurs again – Dep Dec 15 '15 at 08:02
  • compileOptions { sourceCompatibility JavaVersion.VERSION_1_7 targetCompatibility JavaVersion.VERSION_1_7 } - This also does not work – Dep Dec 15 '15 at 08:18
  • compile 'com.android.support:multidex:1.0.0' also did not help – Dep Dec 15 '15 at 08:33
  • You can post your build.gradle – IntelliJ Amiya Dec 31 '15 at 06:18
  • It is working now. Thanks IntelliJ – Dep Dec 31 '15 at 06:21

1 Answers1

0

I had the exact issue. I just upgraded the jdk version from jdk1.7.0_79 to jdk1.8.0_91 and then added to path. Then the Build and Launch was successful.

SO-user
  • 1,458
  • 2
  • 21
  • 43