Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React native Unsupported major.minor version 52

When running

react-native run-android

in my project folder, I get the following error:`

java.lang.UnsupportedClassVersionError: com/android/build/gradle/AppPlugin : Unsupported major.minor version 52.0

I've updated java to the latest version and made sure that I've got all the required build tool sdk versions installed:

compileSdkVersion 23
buildToolsVersion "23.0.3"

defaultConfig {
    applicationId "myappId"
    minSdkVersion 19
    targetSdkVersion 22
    versionCode 1
    versionName "1.0"
    ndk {
        abiFilters "armeabi-v7a", "x86"
    }
}
like image 762
Djakninn Avatar asked Nov 15 '16 13:11

Djakninn


People also ask

How to fix unsupported major version 52?

Unsupported major.minor version 52.0 comes when you are trying to run a class compiled using Java 1.8 compiler into a lower JRE version e.g. JRE 1.7 or JRE 1.6. Simplest way to fix this error is install the latest Java release i.e. Java 8 and run your program. Read more:...

Why do I get error Helloworld unsupported major 52?

If you are getting "java.lang.unsupportedclassversionerror HelloWorld unsupported major.minor version 52.0", which means Java version in your PATH is lesser than Java 8. If you already installed the JDK 1.8 then its due to incorrect PATH setting.

What are the minimum requirements to use React Native with Marshmellow?

Make sure you have installed and targeting at least Android 6.0 Marshmellow and are using Android SDK Build-Tools 23.0.1. See React Native setup docs for more information.

How do I fix Java version 52 0 unsupported?

Unsupported major.minor version 52.0 comes when you are trying to run a class compiled using Java 1.8 compiler into a lower JRE version e.g. JRE 1.7 or JRE 1.6. Simplest way to fix this error is install the latest Java release i.e. Java 8 and run your program.


Video Answer


1 Answers

I had the same problem. I resolved it as follow:

  1. Updated my JDK to 1.8
  2. Changed JAVA_HOME environment variable to point to the folder of new JDK version

Make sure that you're using the new JDK (step 2).

like image 101
Jordan Enev Avatar answered Sep 20 '22 09:09

Jordan Enev