gradle-retrolambda: Unsupported major.minor version 52.0 2.5.0
keep getting error in Android Studio 1.0.1
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'me.tatarka:gradle-retrolambda:2.5.0'
}
}
repositories {
mavenCentral()
}
apply plugin: 'com.android.application'
apply plugin: 'me.tatarka.retrolambda'
retrolambda {
jdk System.getenv("JAVA8_HOME")
oldJdk System.getenv("JAVA7_HOME")
javaVersion JavaVersion.VERSION_1_7
jvmArgs '-arg1', '-arg2'
}
android {
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
compileSdkVersion 21
buildToolsVersion "21.1.1"
defaultConfig {
applicationId "com.aaa.bbb.android"
minSdkVersion 15
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:21.0.3'
}
JAVA7_HOME=C:\Program Files\Java\jdk1.7.0_65 JAVA8_HOME=C:\Program Files\Java\jdk1.8.0_25 JAVA_HOME=C:\Program Files\Java\jdk1.8.0_25
About this issue
- Original URL
- State: closed
- Created 10 years ago
- Reactions: 4
- Comments: 36 (3 by maintainers)
Hi all FYI, It’s happening randomly for a couple of weeks now. I can get rid of it only adding
to my
gradle.properties
.JAVA_HOME
andJAVA8_HOME
are properly set too. IvanJust a heads up, it was as simple as changing the SDK path in project settings to point to my JDK 8 home directory. I had started my project before including this plugin and was at that pointed to 7, but during setup for this library installed 8, but didn’t update my project settings. Updating the path fixed the issue for me. HTH
Note that current Anndroid tools/google libraries require JDK8 or you will get “Unsupported major.minor version 52.0”. This is true even if you are not using Retrolambda.
Change build gradle version it’s work for me before: -classpath ‘com.android.tools.build:gradle:2.2.0’ after: -classpath ‘com.android.tools.build:gradle:2.1.3’
I have the trable (
Unsupported major.minor version 52.0
) in fresh versionclasspath 'me.tatarka:gradle-retrolambda:3.2.3'
. What did i do wrong? There is my gist https://gist.github.com/kolipass/ebaa82476a89946e0505 .I try to use
jvmArgs '-noverify'
and projectlombok then i havelombok/ast/Node : Unsupported major.minor version 52.0
If i didn’t use projectlombok i receivedjava.lang.UnsupportedClassVersionError Unsupported major.minor version 52.0
for every test.Solution: export JAVA_HOME=$JAVA8_HOME
I also faced the same problem, it can be solved by following two steps:
Step 1: Download Java 8. Step 2: Update Android Studio to the latest version 2.2.
Hi All,
I was also facing same issue: Error:(1, 1) A problem occurred evaluating project ‘:app’.
I just updated JDK location on below setting(from “JDK 1.7” to "C:\Program Files\Android\Android Studio" and select the check box for Embedded JDK).
File->Other Settings=>Default Project Struture
For me I just had to restart Android Studio, lol.
I had the same problem. I tried changing JAVA_HOME in several variations but it didn’t help.
My solution was changing JDK location in module settings in Android Studio.
Before this change it was set to java7 which was not working for me.
My build.gradle relevant parts look like this: