依赖
1 | implementation 'com.github.bumptech.glide:glide:4.16.0' |
调用示例
1 | Glide.with(context) |
在 androidx
+ kotlin
的项目中运行,会出现警告日志:
1 | Failed to find GeneratedAppGlideModule. You should include an annotationProcessor compile dependency on com.github.bumptech.glide:compiler in your application and a @GlideModule annotated AppGlideModule implementation or LibraryGlideModules will be silently ignored |
解决办法:
- 依赖增加compiler
1
2implementation 'com.github.bumptech.glide:glide:4.16.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.16.0' - 新增一个类
1
2
3
4@GlideModule
public class MyGlideModule extends AppGlideModule {
// 不用实现
}
这样就没有警告日志啦!