Could not find method kapt() for Glide Could not find method kapt() for Glide android android

Could not find method kapt() for Glide


The project-level build.gradle:

buildscript {    repositories {        mavenCentral()        jcenter()        google()    }    dependencies {        classpath "com.android.tools.build:gradle:3.3.2"        classpath "com.google.gms:google-services:4.2.0"        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.2.70"    }}

The module-level build.gradle:

apply plugin: "kotlin-android"apply plugin: "kotlin-android-extensions"apply plugin: "kotlin-kapt"...android {} dependencies {    implementation "com.github.bumptech.glide:glide:4.8.0"    // annotationProcessor "com.github.bumptech.glide:compiler:4.8.0"    kapt "com.github.bumptech.glide:compiler:4.8.0"}...apply plugin: "com.google.gms.google-services"


plugins {    id 'com.android.application'    id 'kotlin-android'    id 'kotlin-android-extensions'    id 'kotlin-kapt' // add this line in file build.gradle (Module : YourAppName)}


Apply must be under plugins this worked for me

plugins {    id 'com.android.application'    id 'kotlin-android'}apply plugin: "kotlin-android-extensions"apply plugin: 'kotlin-kapt'

And in the other build.grandle:

buildscript {    ext.kotlin_version="1.4.0"    repositories {        google()        mavenCentral()    }    dependencies {        classpath 'com.android.tools.build:gradle:7.0.1'        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"        // NOTE: Do not place your application dependencies here; they belong        // in the individual module build.gradle files    }}