无法找到方法kapt()进行滑行

Raj*_*kar 13 android gradle android-glide kapt

apply plugin: 'com.google.gms.google-services'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'

classpath 'com.android.tools.build:gradle:3.2.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.2.61"
Run Code Online (Sandbox Code Playgroud)

我有上面的gradle配置,但我仍然得到

Could not find method kapt() for arguments [com.github.bumptech.glide:compiler:4.3.1] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
Run Code Online (Sandbox Code Playgroud)

谁能告诉我哪里出错了?我在这里先向您的帮助表示感谢

Mar*_*ler 29

项目级别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"
    }
}
Run Code Online (Sandbox Code Playgroud)

模块级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"
Run Code Online (Sandbox Code Playgroud)


For*_*ran 9

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