Failed to Read Png Signature: File Does Not Start with Png Signature

Error: failed to read PNG signature: file does not start with PNG signature

When you create the .apk all the resources are analyzed and if you get the error message:

Error:error: failed to read PNG signature: file does not start with
PNG signature.

Sample Image

This error is caused because your resource is not really a .png image, the format is incorrect, the file is corrupt or the .png file is really a vector asset.

Sample Image

you can check it by opening your file.

I am trying to build apk of my Flutter project but an error occurs and it fails to build

I think you messed up with the icon files of your app. Try to replace the icon files.

app:mergeReleaseResources exception when making release build

Solved this by using this command gradlew --scan assembleRelease in terminal and it
it gave me following error : D:\Freelance Work\InstaConnect\app\src\main\res\drawable-nodpi\blacktoblue_gradient.png: error: failed to read PNG signature: file does not start wi th PNG signature.

Once i corrected that file , it worked.

Flutter Execution failed for task ':app:mergeReleaseResources'

The builder optimizes the images in your app, in this case the png images. This is to reduce the size of the apk. It is unable to do so in your case. To run without optimization you can put the following in your build.gradle

android {
buildTypes {
release {
crunchPngs false // or true
}
}
}


Related Topics



Leave a reply



Submit