添加Glide v4后的Proguard错误 [英] Proguard error after adding Glide v4

查看:75
本文介绍了添加Glide v4后的Proguard错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

添加glide v4库后,我无法在启用了proguard的情况下生成apk.我在保护规则中添加了以下几行

I am not able to generate the apk with proguard enabled after adding glide v4 library. I have added the below lines in proguard-rules

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

正在构建时显示以下错误.

It's showing the below error while building.

警告:com.bumptech.glide.load.engine.bitmap_recycle.LruBitmapPool:找不到引用的字段'android.graphics.Bitmap $ Config HARDWARE'在库类android.graphics.Bitmap $ Config

Warning:com.bumptech.glide.load.engine.bitmap_recycle.LruBitmapPool: can't find referenced field 'android.graphics.Bitmap$Config HARDWARE' in library class android.graphics.Bitmap$Config

推荐答案

使用以下命令可以忽略这些警告:

It's save to ignore these warning using:

-dontwarn com.bumptech.glide.load.engine.bitmap_recycle.LruBitmapPool
-dontwarn com.bumptech.glide.load.resource.bitmap.Downsampler
-dontwarn com.bumptech.glide.load.resource.bitmap.HardwareConfigState

请参见此帖子

这篇关于添加Glide v4后的Proguard错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆