9

How the fix the gradle error in Android studio after update preview 3?

enter image description here

Peter O.
  • 32,158
  • 14
  • 82
  • 96
Selva Ganesh
  • 151
  • 1
  • 1
  • 5
  • check this http://stackoverflow.com/questions/22489398/unsupported-major-minor-version-52-0 – Amit Vaghela Mar 18 '16 at 05:18
  • what is your java version? – Gueorgui Obregon Mar 18 '16 at 05:40
  • java version "1.8.0_65" – Selva Ganesh Mar 18 '16 at 05:53
  • There can be two main reasons to occur this problem. 1. **Java Version Problem** Check the compatible java version and update your development environments JDK to same version. 2. **Gradle Version Problem** This basically the problem in gradle version. Please check project gradle version is equal to gradle version that you are using in your development environment – Chinthaka Dinadasa Nov 03 '16 at 03:25

2 Answers2

18

You should download the latest jdk

Install it.

Then in Android Studio go to:

File-->Other Settings-->Default Project Structure

And change the location of the JDK Location for the new one:

enter image description here

Also set your java home to 1.8 by command line:

export JAVA_HOME=$(/usr/libexec/java_home -v 1.8)
JpCrow
  • 4,881
  • 4
  • 32
  • 46
3

I had to update my Android Studio to the latest version to solve the problem. My JAVA_HOME and JDK were well configurated and was not a problem of compilation/running version. I don't know why, but just solve it when I updated AS to latest version.