现象描述:

使用Glide开发的时候在debug版本一直没事,但是realease版本各种Crash,报错信息如下:

java.lang.IllegalArgumentException: Unable to find GlideModule to find GlideModule implementation

一开始我就想到了混淆脚本,结果遇到了两个坑:

  1. 网上提供的混淆脚本包名是Glide之前的包名  
  2. Glide内部混淆没关系,但是实现了GlideModule接口的类不能混淆,因为manifest中明确的指明了包名+类名的,混淆了自然就找不到了

解决方法:

加上必要的混淆脚本:

-keep public class * implements  com.bumptech.glide.module.GlideModule
-keep public enum com.bumptech.glide.load.resource.bitmap.ImageHeaderParser$** {
    **[] $VALUES;
    public *;
}
-keep class com.bumptech.** {
    *;
}

相关文章:

  • 2021-08-09
  • 2021-11-30
  • 2021-12-08
  • 2022-12-23
  • 2022-12-23
  • 2021-11-19
  • 2022-12-23
  • 2021-07-07
猜你喜欢
  • 2021-04-09
  • 2021-12-15
  • 2021-12-15
  • 2022-12-23
  • 2021-12-22
  • 2022-12-23
相关资源
相似解决方案