My XML layout is not rendering with this error message. I am already using Java 8.
XML
Also using latest build tools in Gradle.
and
I was facing the same problem recently. Try changing the API preview level to 23 or lower. That worked for me.