jatin rana
jatin rana

Reputation: 835

app:mergeReleaseResources exception when making release build

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?

Upvotes: 4

Views: 10161

Answers (3)

Keshav Gera
Keshav Gera

Reputation: 11264

Failed to read PNG signature: file does not start with PNG signature

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

Its Working 

Upvotes: 1

jatin rana
jatin rana

Reputation: 835

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.

Upvotes: 10

Shiva Snape
Shiva Snape

Reputation: 544

If its due to the PNG files present in the Project, then add the below in gradle.

aaptOptions {  
    cruncherEnabled = false  
} 

Upvotes: 2

Related Questions