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"
我有上面的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.
有人能告诉我哪里错了吗?提前感谢您的帮助
最佳答案
项目级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"
}
}
模块级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"
关于android - 找不到 Glide 的方法 kapt(),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52580584/