Android Studio build error – compileDebugJavaWithJavac task (current target it 1.8) and kaptGenerateStubsDebugKotlin task (current target is 17)

I’m using Android Studio Flamingo | 2022.2.1

I’m getting similar error. These settings worked for me.

build.gradle(:project)

plugins {
    id 'com.android.application' version '8.0.0' apply false
    id 'com.android.library' version '8.0.0' apply false
    id 'org.jetbrains.kotlin.android' version '1.8.10' apply false
}

build.gradle(:app)

...
compileOptions {
        sourceCompatibility JavaVersion.VERSION_17
        targetCompatibility JavaVersion.VERSION_17
    }
    kotlinOptions {
        jvmTarget="17"
    }
...

Gradle Projects Settings

enter image description here

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)