3

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?

jatin rana
  • 825
  • 1
  • 9
  • 21

3 Answers3

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
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
  • Please Post your Logcat also – Shiva Snape Jul 07 '18 at 07:28
  • 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