mjosh mjosh - 5 months ago 3107
Android Question

Android N requires the IDE to be running with Java 1.8 or later?

My

XML
layout is not rendering with this error message. I am already using Java 8.

enter image description here

Also using latest build tools in Gradle.

android {
compileSdkVersion 'android-N'
buildToolsVersion 24.0.0 rc1
...
}


XML Error -

enter image description here

Answer

Set JDK_HOME and JAVA_HOME environment variables, in my case C:\Program Files\Java\jdk1.8.0_60.

enter image description here

Check Java version in Help > About. It should show the JRE version you just set.

enter image description here

That is it, now you can preview your layout in N.