Proguard error with fresco

匿名 (未验证) 提交于 2019-12-03 00:56:02

问题:

I am using ProGuard and when I am running the project in release configuration, I get the following error:

Warning:com.facebook.imagepipeline.bitmaps.DalvikBitmapFactory: can't find referenced field 'android.graphics.Bitmap$Config BITMAP_CONFIG' in program class com.facebook.imagepipeline.nativecode.Bitmaps 

I searched everywhere but couldn't find any clue to solve it. I have updated my proguard-rules.pro with what is given in the fresco's docs page.

Fresco dependency:

compile 'com.facebook.fresco:fresco:0.8.1+' compile 'com.facebook.fresco:imagepipeline-okhttp:0.8.1+' 

回答1:

Hi,According from the error

 Warning:com.facebook.imagepipeline.bitmaps.DalvikBitmapFactory: can't find referenced field 'android.graphics.Bitmap$Config BITMAP_CONFIG' in program class com.facebook.imagepipeline.nativecode.Bitmaps 

It show that the warning com.facebook.imagepipeline.bitmaps.** and so on. my solution is adding the below words to the proguard-rules.pro file

 -dontwarn com.facebook.imagepipeline.** 

I have tried this, and it seems be ok ! be sure you open the build.gradle file ,

android{    ...    buildTypes {       ...       release{          ...          minifyEnabled true          ...       } } 


标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!