I have trying since long to identify the issue but unfortunately not able to
If I do
android.enableAapt2=true
The code
Well, in my case it happened when i upgraded build tools, to resolve this issue, you should have two attr files like in this image:
Add these lines in both of attr.xml files:
This resolved the issue i was facing. Hope it helps someone.