升级Glide4.x的问题:Failed to find GeneratedAppGlideModule. You should include an annotationProcessor c

错误信息:

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’即可

参考:
关于glide4.7.1使用找不到GlideApp的问题

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章