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.
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.
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
Android:Change Button Text and Background Color
How Does One Implement Drag and Drop for Android Marker
How to Unpair Bluetooth Device Using Android 2.1 Sdk
Sqlite Query in Android to Count Rows
Can't Access "Findviewbyid" in Asynctask
Android Studio 4.1 Plugin Error: Plugin * Is Incompatible (Supported Only in Intellij Idea)
Multiple Apps Use Same Content Provider
How to Copy Selected Files from Android with Adb Pull
Getting All the Total and Available Space on Android
Searchview Getactionview Returning Null
How to Get the Battery Level After Connect to the Ble Device
How to Change Color of the Toggle Button
Noclassdeffounderror Below Sdk 21
Android Studio Cannot Resolve R in Imported Project
What Is the Android UI Thread Stack Size Limit and How to Overcome It
Android Studio 3.0 Compile Issue (Cannot Choose Between Configurations)