android - 壁画的 Proguard 错误

标签 android android-gradle-plugin android-build android-proguard

我正在使用 ProGuard,当我在发布配置中运行项目时,出现以下错误:

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

找遍了也没有找到解决问题的线索。我已经用 fresco 的文档页面中给出的内容更新了我的 proguard-rules.pro

壁画依赖:

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

最佳答案

您好,根据报错

 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

它显示警告 com.facebook.imagepipeline.bitmaps.** 等等。 我的解决方案是将以下文字添加到 proguard-rules.pro 文件

 -dontwarn com.facebook.imagepipeline.**

这个我试过了,好像没问题!请务必打开 build.gradle 文件,

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

关于android - 壁画的 Proguard 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33867642/

相关文章:

android - Android Studio 中的阶段文件

java - 应用内计费给我错误

android - 任何人都可以确认任何平板电脑支持 USB 主机模式并且任何人都测试过代码实现

android - Gradle 插件更新到 3.0 后应用程序图标不显示

添加新库后,Android Studio 构建速度变慢?

android - 禁用 Android 资源/图像/PNG 优化

android - 在 Android 源代码中添加预构建的二进制文件

android - SearchView展开抛出空指针异常

android - 带有 gradle 插件 3 的文件中的版本名称和代码

android - 无法在 Android Studio 3.6 上启用 Gradle 的离线模式