Jenkins 流水线在 Android 上失败

时间:2021-08-01 19:59:22

标签: android jenkins gradle kapt

Jenkins 管道项目构建失败并显示错误消息

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:glide:4.9.0'

enter image description here

1 个答案:

答案 0 :(得分:0)

问题似乎不是来自jenkins。 在错误消息中,我注意到确切的问题来自“annotations processing

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:glide:4.9.0'

在您的应用构建 kotlin kapt 文件中添加 gradle 插件

apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'

确保您已在根 kotlin-gradle-plugin 中添加了 build.gradle 类路径

buildscript {
    dependencies {
        ...
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
}

annotationProcessor 替换为 kapt

代替

dependencies {
  implementation 'com.github.bumptech.glide:glide:4.12.0'
  annotationProcessor 'com.github.bumptech.glide:compiler:4.12.0'
}

应该

dependencies {
  implementation 'com.github.bumptech.glide:glide:4.12.0'
  kapt 'com.github.bumptech.glide:compiler:4.12.0'
}