chubbsondubs chubbsondubs - 1 year ago 2480
Android Question

Android Studio continues to get a Unsupported major.minor version 52.0

After merging my project with some changes from other developers I continue to get the following:

Error:Cause: com/android/build/gradle/internal/model/DefaultAndroidProject : Unsupported major.minor version 52.0

I've tried installing Java 8, and setting my project to use Java 8. If I change my JAVA_HOME to 1.8 on the command line and compile with gradle it works. If I try to use JAVA_HOME set to 1.7 and gradle it fails with the same error.

However, in Android Studio, no matter the JDK version, it continues to print that error.

Other developers are saying they are using Java 7 without issue. Other things I've tried:

gradle clean build
gradlew clean build
Reinstalling Android Studio

Another interesting symptom is that other projects in Android Studio are perfectly happy. It's just this project that has this problem.

Here are my environment settings:

OS: Mac OS X 10.9.5
Android Studio: 2.1.1
Android Studio JVM: 1.6
Project JVM: 1.7.0_75
Android SDK (Build Tools): 23.0.2
Gradle: 2.13
JAVA_HOME: /Library/Java/JavaVirtualMachines/jdk1.7.0_75.jdk/Contents/Home
ANDROID_HOME: /Users/me/Library/Android/sdk

I suspect it has something to do with the gradle wrapper, but I can't figure out how to get graddle wrapper to reinitialize itself using 1.7.

Answer Source

Try menu File - > Invalidate caches and restart. Also make sure gradle plugins are latest:

classpath ''
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download