錯誤信息:
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’即可