Android N requires the IDE to be running with Java 1.8 or later?
Set JDK_HOME
and JAVA_HOME
environment variables, in my case C:\Program Files\Java\jdk1.8.0_60
.
Check Java version in Help > About
. It should show the JRE version you just set.
That is it, now you can preview your layout in N
.
Android Nougat requires the IDE to be running with Java 1.8 or later
- Check installed java version, it should be 1.8 or later.
MBP-Vitaliy:~$ java -versionjava version "1.8.0_92"Java(TM) SE Runtime Environment (build 1.8.0_92-b14)Java HotSpot(TM) 64-Bit Server VM (build 25.92-b14, mixed mode)
Android Studio Error Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8
Make sure that your Gradle is using the proper JDK.
Try running ./gradlew --version
in your project's directory. The output should be something like this:
Gradle 7.0-rc-2
------------------------------------------------------------
Build time: 2021-04-01 21:26:39 UTC
Revision: 912a3368b654b71250dfc925a20d620393
Kotlin: 1.4.31
Groovy: 3.0.7
Ant: Apache Ant(TM) version 1.10.9 compiled on September 27 2020
JVM: 11.0.10 (Ubuntu 11.0.10+9-Ubuntu-0ubuntu1.20.10)
OS: Linux 5.11.4-051104-generic amd64
If the JVM points to version 1.8 then you should change it in settings. You can find it in Preferences → Build, Execution, Deployment → Build Tools → Gradle → *Gradle JDK.
android-24' requires JDK 1.8 or later to compile
In Android Studio open:File
> Project Structure
> see if JDK location points to your JDK 1.8 directory.
Note: you can use compileSdkVersion 24
How to solve Android Studio rendering problems?
You have old JDK (Java Development Kit) installed to build apps for Android N. Go to this link (http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html) and install java 1.8 or later.
What is Android N and why does it think I'm building with it? (Android Studio 2.1.2, Windows 7)
So what is Android N ?
It is the next version of Android, API Level 24. The tasty treat is Nougat.
(no, really, that's the name)
Where am I telling it that I need "Android N", and how do I change that?
If you are getting that in the design view, that's the version of Android that is being used for the preview. It defaults to the latest version whose SDK bits you have installed.
To change it, switch it in the bugdroid drop-down on the right side of the design view toolbar:
Related Topics
Why a New Viewmodel Is Created in Each Compose Navigation Route
Upgrade Realm in an Android Project
How to Listen to Doubletap on a View in Android
How to Use and Style New Alertdialog from Appcompat 22.1 and Above
Cannot Enable Gradle's Offline Mode on Android Studio 3.6
Radiogroup with Two Columns Which Have Ten Radiobuttons
Firebase Auth Using Phone Number and Password
How to Send File Using Bluetooth on Android Programatically
How to Handle Ontouch Event for Map in Google Map API V2
Is Ondestroy Not Always Called
How to Send JSON Object to Server Using Volley in Android
How to Get the Fragment Instance from the Fragmentactivity
Google Maps API V2 Supportmapfragment Inside Scrollview - Users Cannot Scroll the Map Vertically
Broadcast Receiver Register in Manifest VS. Activity
Androidruntime: Fatal Exception: Androidmapsapi-Zoomtablemanager