错误信息:
W/Glide:
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
原因是,annotationProcessor ‘com.github.bumptech.glide:compiler:4.9.1’,这个依赖只在 glid封装库 中依赖,没有在主工程依赖。
因为我的glide是一个封装库,封装库内有依赖annotationProcessor ‘com.github.bumptech.glide:compiler:4.9.0’,但主工程却没依赖,导致主工程中不能使用注解@GlideModule,这样就MyAppGlideModule没生效了,这样也导致LibraryGlideModule的所有子类无效。
@GlideModule
public class MyAppGlideModule extends AppGlideModule {
@Override
public boolean isManifestParsingEnabled() {
return false;
}
}
解决方法:主工程也依赖annotationProcessor 'com.github.bumptech.glide:compiler:4.9.1’即可