I am able to create debug build but release build fails with app:mergeReleaseResources and Error: java.util.concurrent.ExecutionException: exception. I have tried setting progaurd off, remove any corrupted png file but still same issue is coming. Any idea what is going wrong here or how to find the reason?
Asked
Active
Viewed 8,864 times
3 Answers
10
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.

jatin rana
- 825
- 1
- 9
- 21
-
THANK YOU! This is such a hard bug to find, this was perfect. Showed me how to find the specific bug in my project – chargerstriker Oct 02 '18 at 03:56
-
How did you corrected the file .? the mysrtie continues – Muhammad Ashfaq Oct 11 '19 at 07:29
-
@MuhammadAshfaq design or download new one and replace old one with new one in project. – jatin rana Oct 11 '19 at 08:33
2
If its due to the PNG files present in the Project, then add the below in gradle.
aaptOptions {
cruncherEnabled = false
}

Shiva Snape
- 544
- 5
- 9
-
Used this already it gave me error : add abort on lint error false. – jatin rana Jul 07 '18 at 07:27
-
-
I found the error. In terminal i used this command line gradlew --scan assembleRelease and 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. – jatin rana Jul 07 '18 at 07:52
1
Failed to read PNG signature: file does not start with PNG signature
android {
buildTypes {
release {
crunchPngs false // or true
}
}
}
Its Working

Keshav Gera
- 10,807
- 1
- 75
- 53