Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unsupported major.minor version 52.0 #37

Closed
mradzinski opened this issue Aug 17, 2014 · 14 comments
Closed

Unsupported major.minor version 52.0 #37

mradzinski opened this issue Aug 17, 2014 · 14 comments
Labels

Comments

@mradzinski
Copy link

Whenever adding the plugin to Android Studio I get:
Error:(2, 0) Cause: me/tatarka/RetrolambdaPlugin : Unsupported major.minor version 52.0

Andriod Studio 0.8.6
Gradle Build Tools 20.0.0

@dbachelder
Copy link

You need to start AS with JDK8 set as JAVA_HOME... just got through the same problem.

@mradzinski
Copy link
Author

Actually setting classpath 'me.tatarka:gradle-retrolambda:2.2.2' to version 2.2.1 solves the issue. It seems this was introduced in the 2.2.2 version.

@evant
Copy link
Owner

evant commented Aug 17, 2014

@mradzinski could you tell me what java.home is set to when you run from Android Studio? Version 2.2.2 was my attempt to fix a case where I was getting an unexpected path, but I may have made it worse instead of better.

@dbachelder
Copy link

When it was set to /Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home it doesn't work for me.

when it's set to /Library/Java/JavaVirtualMachines/jdk1.8.0_11.jdk/Contents/Home it does work

@mradzinski
Copy link
Author

JAVA_HOME: C:\Program Files\Java\jdk1.7.0_45
JAVA8_HOME: C:\Program Files\Java\jdk1.8.0_11

right now I'll try to set JAVA_HOME to use JDK8 and JAVA7_HOME for JDK7, let's see if that makes the trick.

@mradzinski
Copy link
Author

Still throws the error after setting JAVA_HOME to C:\Program Files\Java\jdk1.8.0_11.

By using JAVA_HOME for JDK8 and JAVA7_HOME for SDK7 I managed to make it work, but still have to use version 2.2.1 instead of 2.2.2.

Found out also that compileOptions doesn't work anymore. It resets my language to 1.7.

Here's my app.gradle file:

buildscript {
    repositories {
        mavenCentral()
    }

    dependencies {
        classpath 'me.tatarka:gradle-retrolambda:2.2.1'
    }
}

apply plugin: 'retrolambda'
apply plugin: 'com.android.application'

retrolambda {
    jdk System.getenv("JAVA_HOME")
    oldJdk System.getenv("JAVA7_HOME")
    javaVersion JavaVersion.VERSION_1_7
}

android {
    compileSdkVersion 19
    buildToolsVersion '20.0.0'

    compileOptions {
       sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    defaultConfig {
        applicationId "com...."
        minSdkVersion 14
        targetSdkVersion 19
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
       release {
           runProguard false
           proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
       }
   }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.netflix.rxjava:rxjava-android:0.20.0-RC6'
}

@evant
Copy link
Owner

evant commented Aug 17, 2014

It's supposed to work both ways. @mradzinski could you test with version 2.2-SNAPSHOT? Instructions are in the README for the develop branch.

@evant evant added the bug label Aug 17, 2014
@mradzinski
Copy link
Author

2.2-SNAPSHOT works, it doesn't throws the Unsupported major.minor version 52.0 error. Looks like you changed it to use localGroovy()... perhaps was a groovy issue?

@evant
Copy link
Owner

evant commented Aug 17, 2014

Aha! I changed the dependency from localGroovy() to org.codehaus.groovy:groovy-all:2.3.3 because it was failing if I built it with gradle 2.0. Looks like that caused more issues than it solved. I'll push a release changing that back and make sure to build with gradle 1.x for now.

@mradzinski
Copy link
Author

ehmmm... maybe a little late, but... maybe forgot to mention classpath 'com.android.tools.build:gradle:0.12.2'

@evant
Copy link
Owner

evant commented Aug 17, 2014

Alright, fixed in 2.2.3, please allow time to sync. @dbachelder You said your having an issue with using JAVA_HOME=java7 and JAVA8_HOME=java8? If so, could you open a new issue? That is supposed to work.

@evant evant closed this as completed Aug 17, 2014
@dbachelder
Copy link

@evant I'll try the 2.2.3 and let you know if the problem persists.

@mradzinski
Copy link
Author

Sounds just right! let's close this issue now and forever :)
Thanks both

@Orabig
Copy link

Orabig commented Feb 5, 2015

I had this issue too, but making the JAVA_HOME point to JDK8 was not sufficient.
There is a (slightly hidden) parameter in Android Studio to change, hidden at File->Other Settings->Default Project Structure->SDKs
The solution was here : [http://stackoverflow.com/questions/16823790/android-studio-dont-know-where-is-java]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants