UnsupportedClassVersionError - major.minor version 52.0

Answered

I have a project that has been working with Android Studio, now I'm trying to open it in Idea 2016.1.3. I get this error:

Error:Android Gradle Build Target: java.lang.UnsupportedClassVersionError: org/jetbrains/kotlin/android/KotlinOutputParser : Unsupported major.minor version 52.0

I figure this is something to do with the JRE being used, but I have no idea how to fix it. My project SDK is Java 1.7.0_51

7 comments
Comment actions Permalink

Please see https://youtrack.jetbrains.com/issue/KT-12159.

Updating Kotlin should fix the problem.

0
Comment actions Permalink

How do I update to 1.0.3? In preferences/Plugins the only version offered is 1.0.2.

0
Comment actions Permalink

Wait for the release then, you can disable the plug-in as a workaround.

0
Comment actions Permalink

Ok, with the Kotlin plugin disabled I get this error:

Error:Gradle: Execution failed for task ':app:compileDebugKotlin'.
> Compilation error. See log for more details

The log doesn't actually contain details, it just says:

4:17:34 PM Compilation completed with 1 error and 0 warnings in 7s 20ms

However if I run gradlew from the command line I see:

EditLeg.kt: (17, 39): Unresolved reference: keyboard

Line 17 in EditLeg.kt is: 

import kotlinx.android.synthetic.main.keyboard.*

Seems to me that isn't going to work without the Kotlin plugin. Any other ideas?

I have right now just three small Kotlin source files in the project - should I just convert them back to Java and wait until the Kotlin implementation is a little more mature?

 

0
Comment actions Permalink

You can try switching project JDK to 1.8 and see if it helps. Otherwise get rid of the Kotlin files until the fix is released.

0
Comment actions Permalink

I don't think 1.8 works with Android, so that isn't a viable option. I did however find that using Idea 15 with the 1.01 Kotlin plugin, and changing the Kotlin version in build.gradle to 1.01 made the "Unsupported major.minor version 52.0" error go away. I don't know which if any of those variables made the difference - I can't find a way of downgrading the plugin in Idea 2016 to 1.01. Building with gradlew from the command line is ok.

The other error ("unresolved reference: keyboard") appears to be a completely different bug - the "keyboard" view was defined in a layout file in a library module, included in a project layout file using "

<include layout="@layout/keyboard"/>

Copying the keyboard.xml file into the layout/ directory of the app module itself made that go away. So there seems to be a problem with the Kotlin Android extensions finding views in library modules. Anyway, that's easy to work around.

So, once again I am back to being able to make progress but only by using Idea 15. The 2016 version has been out for 6(?) months and is still unusable, at least by me, albeit because of different bugs than I ran into previously.

0
Comment actions Permalink

The issue is reproduced with Kotlin 1.0.2 and Idea 2016.1.3 so I have reopened https://youtrack.jetbrains.com/issue/KT-12159. You can "star" the issue to monitor the status.

In case you'll have any troubles with Kotlin plugin in future you can file issues into the tracker (https://youtrack.jetbrains.com/issues/KT) directly.

Thank you!

0

Please sign in to leave a comment.