My XML
layout is not rendering with this error message. I am already using Java 8.
Also using latest build tools in Gradle.
and
I got the same error you describe but on OS X. I know this may not solve your problem (because I don't know the equivalent for Windows), but since this is not OS specific I am leaving the solution for any OS X fellow out there.
Edit the file /Applications/Android\ Studio.app/Contents/Info.plist
, and remove the 1.6 version (in my case), you may place 1.6+, 1.7+ or 1.8, whichever you prefer. Mine ended up like this
...
<key>JVMVersion</key>
<string>1.7+</string>
...
Be aware there's an incompatibility with drag and drop with java versions 1.8_60 to 1.8_75 (IDEA-146691) which the IDE will report once you successfully change the version.
For non Terminal Users
Android Studio.app
file. If it's in the dock you can right click it and choose Options > Show in Finder
.Show package content
. Contents/Info.plist
).I was facing the same problem recently. Try changing the API preview level to 23 or lower. That worked for me.
try to use in project Java 1.8 - download last version of JDK and install it(if JSK is absent)
Then add to build.gradle these lines android { ... // Configure only for each module that uses Java 8 // language features (either in its source code or // through dependencies). compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } // For Kotlin projects kotlinOptions { jvmTarget = "1.8" } }
There are several thing to remember when set the STUDIO_JDK on Mac OS:
The difference between two is that Apple's Java IMO provides nicer and better fonts antialiasing in the IDE.
A reply here is referencing a bug in Android Studio regarding the fonts antialiasing. The ticket is already closed but still rendering is different for Apple Java and Oracle SDK (I have v1.8.0_102). And the former still has better perception than the last.
machine: windows8 64bit in my case the jdk1.7 I had installed was 32bit hence I was using studio.exe (32bit) so even when I downloaded the new jdk1.8 (64bit) the studio instance I was using (32bit) couldn't detect it, but when I uninstalled the older jdk and tried to rerun studio.exe I was told to install a 32bit jdk. so I ran studio64.exe and it ran smoothly. ensure you have the correct path in your environment variables. cheers android N
I faced the problem "Android N requires the IDE to be running with Java 1.8 or later." The error kept showing up in spite of setting C:\Program Files\Java\jdk1.8.0_92
as the project's JDK in File > Project Structure
.
I solved it by updating JAVA_HOME in my environment variables from C:\Program Files\Java\jdk1.7.0_67
to C:\Program Files\Java\jdk1.8.0_92
. When I did that and restarted Android Studio, the design mode became available.
OS: Windows 10
Android Studio: 2.1.2