I am usingandroid.enableAapt2 = false
in my gradle.properties
file. After updating android studio to 3.1 my project showing a warning to update or
When upgrading Gradle and starting to use Aapt2 I also got some similar errors building the project. In my case the problem was in a drawable resource file that required a higher API version as it was my minSdkVersion set in build.gradle. The main problem was that file did not show any error until you opened it, so it was hard to find it at all. I have spent at least 4 hours trying other things, since as an error when building the project it showed another drawable resource (as not found) files that did not have any problems at all. After removing the drawable that required the higher API the app built normally.
Gradle 4.4, com.android.tools.build:gradle:3.1.4, Android studio: 3.1.4