使用Glide4.x想更换网络组件,引入了官方库okhttp集成库
implementation 'com.github.bumptech.glide:okhttp3-integration:4.13.1'
然后编译报错如下:
> Task :app:kaptDebugKotlin FAILED 注: [1] Wrote GeneratedAppGlideModule with: [com.bumptech.glide.integration.okhttp3.OkHttpLibraryGlideModule] Execution failed for task ':app:kaptDebugKotlin'. > A failure occurred while executing org.jetbrains.kotlin.gradle.internal.KaptWithoutKotlincTask$KaptExecutionWorkAction > java.lang.reflect.InvocationTargetException (no error message)解决
引入Glide compiler时使用annotationProcessor而非kapt。
Glide源码使用的是Java,使用kapt的话会导致编译时找不到Java注解类。
implementation 'com.github.bumptech.glide:glide:4.13.1'
implementation 'com.github.bumptech.glide:okhttp3-integration:4.13.1'
//使用kapt会导致部分使用Java注解的类无法编译
annotationProcessor 'com.github.bumptech.glide:compiler:4.13.1'
https://github.com/bumptech/glide/issues/4614


![Android Glide4.x 注: [1] Wrote GeneratedAppGlideModule Android Glide4.x 注: [1] Wrote GeneratedAppGlideModule](http://www.mshxw.com/aiimages/31/777694.png)
