Kodi Arasan M
Kodi Arasan M

Reputation: 5

Build Failed with an exception even I changed the gradle to 7.0.3 and also the gradle JDK in Android Studio to version 11

Configure project :app app: 'annotationProcessor' dependencies won't be recognized as kapt annotation processors. Please change the configuration name to 'kapt' for these artifacts: 'com.github.bumptech.glide:compiler:4.12.0'.

FAILURE: Build failed with an exception.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.2/userguide/command_line_interface.html#sec:command_line_warnings

Upvotes: 0

Views: 917

Answers (1)

Martin Schwarzbock
Martin Schwarzbock

Reputation: 26

I had the same error and struggled for a long time to fix it, you have to make some changes in gradle.

First add this to the classpath:

buildscript {
repositories {
    ...
    ...
}
dependencies {
    classpath "com.android.tools.build:gradle:7.0.4"
    classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.10'

    //add the newest ksp maven version here
    classpath "com.google.devtools.ksp:com.google.devtools.ksp.gradle.plugin:1.7.20-Beta-1.0.6"
    ...
}



}

Be sure that the ksp version match with your kotlin plugin version, you can also check the maven website here: maven

Then in the build.gradle add the ksp plugin, add the new ksp compileOption and change the kap annotatons to ksp:

        plugins {
    ...
    ...
    id 'com.google.devtools.ksp'
    }
    android{
    ...
    ksp {
        arg("room.schemaLocation", "$projectDir/schemas".toString())
    }
    ...
    
}
dependencies {
    ...
    //room
    def roomVersion = "2.4.3"
    implementation("androidx.room:room-runtime:$roomVersion")
    //replace kap with ksp and should work correctly
    ksp "androidx.room:room-compiler:$roomVersion"
    implementation("androidx.room:room-ktx:$roomVersion")
    ...
}

Upvotes: 0

Related Questions