After I upgraded my Android studio and gradle plugin, I ran into similar issue because of the below line.
I was using this <import type="java.lang.String" />
in my layout file.
Removing this import solved the issue.
Just as in managed code, java.lang.* is imported automatically.