This is the output of my Gradle console, I am unable to build my project
D:\\Android Projects\\....\\app\\src\\main\\res\\layout\\topic_view_header.xml
Error
I had exactly the same issue: After updating to Android Studio 3.1.2 my project wouldn't compile with an AAPT2 error telling me some of my drawables which are referenced by styles.xml
could not be found. Disabling AAPT2 isn't a solution anymore, since the setting is deprecated and will be removed at the end of 2018.
Culprit was an empty line just before the xml decleration in a totally unrelated layout.xml
file... So the layout.xml
file started like this:
//empty line//
Removed the empty line and everything worked like a charm again. Unbelievable and unlikely, but true.
Android Studio actually gave a warning because the file didn't start with the xml decleration (because of the empty line). But the warning is only visible when the file is opened in the editor.