Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to run react native project due to java version 10

Tags:

react-native

I have got the react native installation done but with latest jdk version that is v10.
Now when I try to run the project using the command react-native run-android, I am getting the following error,

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine java version from '10'.

I'm pretty much new to the MAC environment, How do I roll back to the previous working version of java in Mac? How I can fix this issue?

like image 961
Abhishek D Avatar asked Mar 26 '18 05:03

Abhishek D


People also ask

Does react native work with JDK 11?

As a requirement to run, PSPDFKit for React Native needs the latest stable version of Android Studio. Starting with version 4.2 , Android Studio is now bundled with JDK 11.

Which JDK for react native?

React Native requires at least the version 8 of the Java SE Development Kit (JDK). You may download and install OpenJDK from AdoptOpenJDK or your system packager. You may also Download and install Oracle JDK 14 if desired.


Video Answer


2 Answers

Downgrade the Java version. This is a problem with the latest version of java.

like image 98
Abhishek sheshagiri Avatar answered Oct 29 '22 02:10

Abhishek sheshagiri


You need a change in the Android

Gradle properties file.

PROJECT_PATH/android/gradle/wrapper/gradle-wrapper.properties

Update your distributionUrl to the following

distributionUrl=https\://services.gradle.org/distributions/gradle-4.3-rc-2-all.zip
like image 34
TheParam Avatar answered Oct 29 '22 03:10

TheParam