Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio: "libpng warning: iCCP: Not recognizing known sRGB profile that has been edited"

Tags:

android

I spent some hours trying to solve this:

app:mergeDebugResources AAPT err(927129865): C:\Users\Will\AndroidStudioProjects\Splitter2\app\build\intermediates\exploded-aar\com.android.support\appcompat-v7\22.0.0\res\drawable-hdpi-v4\abc_spinner_mtrl_am_alpha.9.png:

libpng warning: iCCP: Not recognizing known sRGB profile that has been edited

My project is finally running but every time I make a clean built it shows this warning again.

I updated my buildToolsVersion to "22.0.1" and I am using tools.build:gradle "1.2.3". I'm still getting this error.

Everything started when I tried to use FancyButton.

Someone knows how to solve this problem?

like image 630
Will Avatar asked Jul 18 '15 20:07

Will


4 Answers

It's just a warning, which libpng started issuing at version 1.6.0, so you can ignore it.

To get rid of the warning, you need to fix the PNG file that's named in the warning. You can use any one of a number of PNG image editors (ImageMagick, GraphicsMagick, etc.) to remove the offending iCCP chunk. Or you can downgrade your libpng to version 1.5.x.

See the similar question libpng warning: iCCP: known incorrect sRGB profile

like image 65
Glenn Randers-Pehrson Avatar answered Oct 20 '22 02:10

Glenn Randers-Pehrson


It happens to me since buildToolsVersion 23.0.1. I don't know the reasson yet, but if you use ImageOptim (for MAC) with those image files, you'll get rid of that error, it removes junk metadata and unnecessary color profiles.

I hope it helps.

like image 42
Mr.Moustard Avatar answered Oct 20 '22 02:10

Mr.Moustard


I tried to fix the problem and get these annoying warnings disappeared. What really helped me: delete meta data from your png file (I guess you don't need it).

brew install exiftool
find . -path '*src/main/res/*' -name '*.png' -exec exiftool -overwrite_original -all= {} \;

See details in Jake Wharton's answer https://groups.google.com/forum/#!msg/adt-dev/rjTQ_STR3OE/-UcNQRISTKsJ

like image 24
Silwester Avatar answered Oct 20 '22 03:10

Silwester


Add this in your build.gradle for your module

aaptOptions { cruncherEnabled = false }

this will resolve the issue/error

like image 39
shaiban Avatar answered Oct 20 '22 03:10

shaiban