GlideApp无法生成的问题

在Glide4.x之后,流式api使用的GlideApp可能发生无法编译生成的问题。

# 这个如果在 lib-module 中,使用 api 'xxx'
implementation 'com.github.bumptech.glide:glide:4.9.0'
#这个annotationProcessor,需要放在 app-module 中
annotationProcessor 'com.github.bumptech.glide:compiler:4.9.0'

kotlin代码使用如下配置(kapt需要在app-module的build下):

apply plugin: "kotlin-android"
apply plugin: "kotlin-android-extensions"
apply plugin: "kotlin-kapt"
android {
dependencies {
    implementation "com.github.bumptech.glide:glide:4.9.0"
    // annotationProcessor "com.github.bumptech.glide:compiler:4.9.0"
    kapt "com.github.bumptech.glide:compiler:4.9.0"
apply plugin: "com.google.gms.google-services"
// 这个AppGlideModule需要放在 app-module 中的应用名的包下(比如application id: com.example.glide)
package com.example.glide