发布于 3年前

过滤Android Studio的[libpng error: Not a PNG file Error]错误

当出现该问题时,在Logcat是没有提示到底哪张图片出问题了,如果一个项目中的png图片非常多,那处理这个问题绝对是个噩梦。经过搜索,发现可以使用以下方式绕过这个错误:

android {
    compileSdkVersion 17   
    buildToolsVersion "24.0.2"   
    ....
    //Returns true if the PNGs should be crunched, false otherwise.
    aaptOptions{ 
       cruncherEnabled = false  
   }
  ....
}
©2020 edoou.com   京ICP备16001874号-3