If you encounter this problem when creating a release build, keep in mind that the Android plugin for Gradle 2.2.0 (and higher) seems to have an error with shrinkResources .
Reduce gradle to 2.1.3 for workaround:
classpath 'com.android.tools.build:gradle:2.1.3'
EDIT:
I reported this issue wojtek.kalicinski (Destination for Android Developer on Google).
As it turned out, shrinkResources only works if there is minifyEnabled set to true . 2.1.3 version of Android Plugin simply ignored the problem (and without shrinkResources ). 2.2.0+ lets you know that something is wrong with the error (which in itself is not very informative). In the future, Google may submit a better error message for such scenarios.
Here is twitter :

Bartek Lipinski Sep 27 '16 at 10:16 2016-09-27 22:16
source share