【问题标题】:Jenkins Pipeline failed for AndroidAndroid 的 Jenkins 流水线失败
【发布时间】:2021-10-07 08:31:21
【问题描述】:

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

【问题讨论】:

    标签: android jenkins gradle kapt


    【解决方案1】:

    看来问题不是来自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'
    

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

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

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

    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'
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-09-29
      • 1970-01-01
      • 1970-01-01
      • 2022-01-27
      相关资源
      最近更新 更多