最近在适配androidx
遇到一个异常: GeneratedAppGlideModuleImpl is implemented incorrectly.
2021-07-20 16:03:37.128 19685-19685/com.xxx W/System.err: java.lang.IllegalStateException: GeneratedAppGlideModuleImpl is implemented incorrectly. If you've manually implemented this class, remove your implementation. The Annotation processor will generate a correct implementation.
2021-07-20 16:03:37.131 19685-19685/com.xxx W/System.err: at com.bumptech.glide.Glide.throwIncorrectGlideModule(Glide.java:368)
2021-07-20 16:03:37.131 19685-19685/com.xxx W/System.err: at com.bumptech.glide.Glide.getAnnotationGeneratedGlideModules(Glide.java:360)
2021-07-20 16:03:37.131 19685-19685/com.xxx W/System.err: at com.bumptech.glide.Glide.get(Glide.java:188)
这个异常看起来跟glide有关。
大致意思是:GeneratedAppGlideModuleImpl实现不正确。如果你手动实现了这个类,请删除你的实现。注释处理器将生成正确的实现。
想起来在适配过程中,没有对glide做处理。

看了一下,所用glide版本是4.9.0,这个版本支持的是support库。
查证,glide是从4.11.0开始才适配了androidx。故需要升高glide版本。
glide_version = "4.12.0"
编译,运行成功,没有再报这个异常了。
在升级到AndroidX的过程中遇到了GeneratedAppGlideModuleImpl错误,原因是使用的Glide版本4.9.0不支持AndroidX。通过检查发现Glide从4.11.0开始才支持AndroidX。因此,将Glide版本升级到4.12.0解决了问题,运行时不再出现该异常。
7777





