For my case, my original Android SDK Build-tools version is 24 and Andoid SDK Tools version is 25.1.7. I install Android SDK Build-tools version 23.0.3 by Andoird SDK manager.
Changing to Java SDK to Java 8 worked for me.
Android Studio settings: File -> other settings ->Default project structure -> JDK location -> jdk1.8.0_71.jdk/Contents/Home
With the latest version, you are recommended to switch to the embedded JDK like in the image below, and this will solve your error
Changing to Java SDK to Java 8 and worked for me
Android Studio settings:
File > other settings > Default project structure > JDK location > jdk1.8.0_71.jdk/Contents/Home
For my case, my original
Android SDK Build-tools
version is 24 andAndoid SDK Tools
version is 25.1.7. I installAndroid SDK Build-tools version 23.0.3
by Andoird SDK manager.Modify these 2 lines to:
buildToolsVersion "23.0.3" compileSdkVersion 24
Then it works!
Changing to Java SDK to Java 8 worked for me. Android Studio settings: File -> other settings ->Default project structure -> JDK location -> jdk1.8.0_71.jdk/Contents/Home
This is bug in Android Studio. Usually you get error: Unsupported major.minor version 52.0
WORKAROUND: If you have installed Android N, change Android rendering version with older one and the problem will disappear.
SOLUTION: Install Android SDK Tools 25.1.3 (tools) or higher
For me, updating the Android Studio to the latest version solved the problem.