build failing during merge resources with Android Gradle plugin 3.3.0

Updated 19th April, 2019

This issue has been fixed in Android Gradle Plugin 3.4.0.

After upgrading to Android Studio 3.4.0, the temporary fix suggested in the original answer can be removed. Hurray!


This is a bug in AAPT2 in Android Gradle Plugin 3.3.0, when building a project with larger png’s (around 2-3 mb and up).

@akong9759 created an issue for this on Googles issue tracker and it has been fixed.

The problem has been fixed in Android Gradle Plugin 3.5.0-alpha03 and the fix is scheduled to be released in version 3.4.0.

A temporary fix for Android Gradle Plugin 3.3.0 has been suggested on the issue. Add the following to the project build.gradle:

allprojects {
    // Workaround for
    // Remove when upgrading to AGP 3.4 or higher.
    configurations.matching { == '_internal_aapt2_binary' }.all { config ->
        config.resolutionStrategy.eachDependency { details ->

Leave a Comment