0

After trying about 5 or 6 accepted answers on here and also trying a few of my own, i have done everything i know how from a fresh install to deleting the .gradle folder to changing the dex options in build.gradle and after every time i get this error:

Error:Process 'command '/home/draven/Downloads/android-studio/jre/bin/java'' finished with non-zero exit value 2

Im sorry for a lack of information as i am a bit frustrated, but i will give all relevant information needed.

Log: Pastebin of the Log

Here is a screenshot of the error, the IDE is a fresh install.

Screenshot of the IDE

Draven Lewis
  • 47
  • 1
  • 7

2 Answers2

0

Please verify you have the proper Java jdk version is installed. Refer: Is it possible to use Java 8 for Android development?

Other possible reason is the dependency issue. Have you tried Clean Project and Rebuild? If yes, can you please share a screenshot of your build.gradle

Community
  • 1
  • 1
slyidiot
  • 78
  • 9
  • 1
    Ok, thank you for your answer but java may not be the issue. After both reading the log and checking the directory referenced in the log android studio comes with a JRE of its own. I know it is recomended but not required to have a JDK installed for an android app to compile as android studio compiles fine on my windows10 PC without a JDK. Also i do not think the JRE is the issue, aside form the aformention included JRE, the windows10 PC is using JRE 1.8 (Java8) and my ubuntu work pc has both Oracle JRE 1.8 and JDK 1.8 alone. – Draven Lewis Dec 31 '16 at 13:16
  • okay. maybe some dependency issue. i'm new to studio, so sorry if my answers are useless – slyidiot Dec 31 '16 at 13:19
  • 1
    Update: The Embeded JDK does not work it seems the system cannot execute the file: – Draven Lewis Dec 31 '16 at 13:22
  • bash: /home/draven/Downloads/android-studio/jre/jre/bin/java: cannot execute binary file: Exec format error – Draven Lewis Dec 31 '16 at 13:22
  • 1
    After providing Android Studio with a valid JDK it works! – Draven Lewis Dec 31 '16 at 13:33
  • that's wht i meant na? .-. – slyidiot Dec 31 '16 at 14:38
  • Also i have found out that its not only the file exec problem its actually that the SDK for linux is compiled to work with 64bit machines. And i run a 32bit linux, so ill just switch over to my 32bit windows and it sould work every time. (as google still supports 32bit windows) – Draven Lewis Jan 03 '17 at 03:06
0

For default, android studio use a embedded java, you can try change it for a external one, in file -> project structure -> sdk location section -> jdk location. That worked for me. Regards!