添加 glide v4 库后,我无法生成启用了 proguard 的 apk。 我在 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 *;
}
构建时显示以下错误。
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
最佳答案
使用以下方法可以忽略这些警告:
-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
查看此 post
关于android - 添加 Glide v4 后的 Proguard 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46232898/