Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

why java.exe exit with value 1 in android studio

Tags:

android

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_75\bin\java.exe'' finished with non-zero exit value 1

like image 505
AISHWARYA MITTAL Avatar asked Mar 10 '15 06:03

AISHWARYA MITTAL


2 Answers

upgraded gradle version

classpath 'com.android.tools.build:gradle:1.1.2'

and updated android studio worked

like image 139
nahlamortada Avatar answered Oct 20 '22 07:10

nahlamortada


Found 2 resolutions.

I. First one is simple. Open AS error log file (generated in project directory) and if it contains information that there is not enough memory for Java to do it's job - simply close unnecessary applications to free memory and run again.

II. Another one is due to corrupted project files (for some reason): Do project clean up and then import again in Android Studio (AS). That's how to do it in details.

  1. File -> Close project (if it is opened in AS)
  2. Open project directory, search for *.iml files and remove all of them
  3. Remove all generated by AS and build process directories: .gradle .idea build
  4. After that open AS and import project again. Now, wait, wait, wait and you should now be able to run again.

Note: that you'll end up without all project specific AS settings.

That's simply the thing, which I do from time to time when upgrading to latest AS. That is one of the reasons I never commit those AS-related files to VCS (and teammates allways do import in AS after fresh check out from VCS)

like image 34
Deepscorn Avatar answered Oct 20 '22 07:10

Deepscorn