9

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?

Abhishek D
  • 465
  • 2
  • 9
  • 24
  • 1
    This generally means that the Java might have been deleted successfully, but its environment path still remains, either you may follow the steps in the post [mentioned](https://stackoverflow.com/questions/24342886/how-to-install-java-8-on-mac/28635465) here or try changing your `java env variable` – Pritish Vaidya Mar 26 '18 at 06:48

2 Answers2

14

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
TheParam
  • 10,113
  • 4
  • 40
  • 51
1

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

Bradley Flood
  • 10,233
  • 3
  • 46
  • 43
  • 4
    IMHO: To call this a "problem with the latest version of Java" is a bit of a stretch when the core problem lies in the fact that RN _still_ creates a Android-wrapper-project like it was 2013 (when Android API 23 was released). – SiCN Jun 23 '18 at 16:53