3

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

LolXDDev
  • 63
  • 1
  • 5

2 Answers2

1

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

Jakoss
  • 4,647
  • 2
  • 26
  • 40
0

Similar to Jakos, I found the following in my app\build.gradle :

compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_5
    targetCompatibility JavaVersion.VERSION_1_5
}

This was probably left over from upgrading an eclipse project, once removed the project compiled.

Benno
  • 2,534
  • 1
  • 17
  • 27