Question Details

No question body available.

Tags

android android-studio android-gradle-plugin gradle-plugin

Answers (1)

February 4, 2026 Score: 0 Rep: 21,762 Quality: Low Completeness: 70%

This occurs when you note the kotlin block inside of the android block, like this:

android {
    // ...

kotlin { compilerOptions { jvmTarget.set(JvmTarget.JVM17) } } }

The kotlin block belongs on the top-level of the gradle file though, so it looks like this:

android {
    // ...
}

kotlin { compilerOptions { jvmTarget.set(JvmTarget.JVM17) } }

That said, with AGP 9 you do not even need to provide the jvmTarget explicitily because AGP will set it to android.compileOptions.targetCompatibility by default. If this is the only thing you use the kotlin block for then the proper solution would be to simply remove it entirely.