Search code examples
androidandroid-studioandroid-studio-3.0android-studio-3.1

Target option 1.5 is no longer supported. Use 1.6 or later


I keep getting this error message when compiling my app to an apk: error message I've found a lot of posts about pom.xml I tried multiple times to find the pom.xml file. So does anyone know where it is or how to fix this error?

This is my android studio version btw: version


Solution

  • Newest Android Studio does not support java 1.5 as a compilation target. Switch to 1.6 or later (newest recommendation is java 11). Here is how:

    android {
        compileSdkVersion 30
    
        compileOptions {
          sourceCompatibility JavaVersion.VERSION_11
          targetCompatibility JavaVersion.VERSION_11
        }
    
        // For Kotlin projects
        kotlinOptions {
          jvmTarget = "11"
        }
    }
    

    source