Unsupported major.minor version 52.0 in my app

后端 未结 28 2267
心在旅途
心在旅途 2020-11-28 03:43

I\'m trying to compile my Android project and I\'m getting this error

[INFO] Exception in thread \"main\" java.lang.UnsupportedClassVersionError: com/android         


        
相关标签:
28条回答
  • 2020-11-28 04:15

    I had the same problem and tried to change the version, sometimes is for the version of Android Studio in Project> Gradle Scripts> build.gradle(Module:app) you can change the version. For example:

    android {
        compileSdkVersion **23**
        buildToolsVersion **"23.0.3"**
    
        defaultConfig {
            applicationId "com.example.android.myapplication"
            minSdkVersion **19**
            targetSdkVersion **23**
            versionCode **1**
            versionName **"1.0"**
        }
    
    0 讨论(0)
  • 2020-11-28 04:17

    I face this problem too when making new project from android studio.

    I've been able to resolve this by downgrading buildToolsVersion in app gradle setting: change {module-name}/build.gradle line

    buildToolsVersion "24.0.0 rc1"

    to

    buildToolsVersion "23.0.3"


    @Edit:
    In Android Studio 2.1 Go to File-> Project Structure->App -> Build Tool Version. Change it to 23.0.3

    Do the method above, only when you are using java version 7 and for some reason do not want to upgrade to java 8 yet.

    Hope this helps

    0 讨论(0)
  • 2020-11-28 04:17

    I had the same problem with my IntelliJ Maven build. My "solution" was to go into the build tools and remove the build tools 24.0.0 folder. I found it in the {android-sdk-location}/build-tools/ directory. This is not a long term fix, but this should at least get your project building again. Upgrading to Java 8 as many have suggested will be better long term.

    0 讨论(0)
  • 2020-11-28 04:18

    unsupported-major-minor-version error can be because of unsupported JDK version. Update JDK, Go to Module Settings and change the JDK path to the new one. In most of the cases, it fixes the error.

    0 讨论(0)
提交回复
热议问题