It's likely a JPG
renamed to a PNG
file, not an actual PNG file
The problem could be because of the wrong extension of images.
In my case, the file was a JPEG
image but it was saved as PNG
not converted to. In this situation change extension to the real one and convert to PNG then retry.
For instance, you have ic_logo.png
but it's actually a JPG image.
You should rename it back to ic_logo.jpg
and use something like Photoshop to convert the image to PNG format.
In build.gradle
aaptOptions { cruncherEnabled = false }
Delete content inside C:\Users\.gradle\caches
android {
buildTypes {
release {
crunchPngs false // or true
}
}
}
buildTypes {
debug {
signingConfig signingConfigs.debug
}
release {
crunchPngs false // or true
lintOptions {
checkReleaseBuilds false
abortOnError false
}
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
Creating the .apk of an application all the resources are analyzed, if some resource has an incorrect format or is corrup you will get the message:
.png failed to read PNG signature: file does not start with PNG signature
Be sure to have the correct resources, you can check it by opening your file.
This occurs due to the incorrect extension given to the image. For example, the image is jpg and the extension given is png.
Solutions:
{ cruncherEnabled = false }
in build.gradleIf you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With