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 have solved it in these way.(AS+MAC OX El Capitan)
Go to Help>Edit Custom Properties> A dialog will prompt(press yes) then write
JVMVersion=1.8
Then close Android Studio fully and reload the project