How the fix the gradle error in Android studio after update preview 3?
Asked
Active
Viewed 2.1k times
9
-
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 Answers
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:
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
-
2
-
Is the `export JAVA_HOME=...` step necessary? And why? The first step (setting the JDK location) was the working solution for me on Android Studio as of 8.9.16 – LazerSharks Aug 09 '16 at 22:56
-
-
1. Download and install the latest java version first. (www.java.com) 2. Set JDK location to: C:\Program Files\Java\jdk1.8.0_112 – Andy Barth Jun 21 '17 at 23:56
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.