Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8. React Native

Viewed 1536
2 Answers

what you need to do;

  1. log into my computer
  2. right click and select properties
  3. enter advanced system settings
  4. add new path name: JAVA_HOME
  5. select the java 11 jdk location and save it

or

  1. open cmd for adminstator
  2. setx JAVA_HOME -m "path"

After doing all of them, delete your old React Native project and install a new one.

or

  1. open project with android stiduo
  2. find node_moduls -> react-native-gradle-plugin -> build.gradle -> change java 1.8 to java 11.0

Try following commands:

nano ./zshrc

Find JAVA_HOME and replace with your v11 java path. You can find the path here:

/usr/libexec/java_home -V

Save the file, re-launch the terminal and try again.

Related