React Native error: “Could not determine java version from '9.0.1'.”

前端 未结 11 1714
悲&欢浪女
悲&欢浪女 2020-11-28 03:50

I\'m working on MacOS and just starting with react-native.

One of the first steps to get started is to run: react-native run-android or

相关标签:
11条回答
  • 2020-11-28 03:54

    On MacOS, I ran the following commands:

    brew cask uninstall java
    brew tap caskroom/versions
    brew cask install java8 "or just brew cask install java to install latest version"
    
    0 讨论(0)
  • 2020-11-28 03:54

    I solve this by downgrading my JDK to 8.

    0 讨论(0)
  • 2020-11-28 03:58

    On Ubuntu, you should run these command lines in the terminal:

    sudo add-apt-repository ppa:webupd8team/java
    sudo apt-get update
    sudo apt install oracle-java8-installer
    sudo apt install oracle-java8-set-default
    
    0 讨论(0)
  • 2020-11-28 03:59

    I usually get this error when I forget to build the project using Android Studio. A simple sync and upgrading Gradle will do the work.

    0 讨论(0)
  • 2020-11-28 04:02

    In your PROJECT_PATH/android/gradle/wrapper/gradle-wrapper.properties file, update your distributionUrl to the following:

    distributionUrl=https\://services.gradle.org/distributions/gradle-5.0-all.zip
    

    See related gradle distributions documentation

    0 讨论(0)
  • 2020-11-28 04:02

    ---- December 2018 --- keep attention --- React Native does not work with Java versions higher than 8, so you need to uninstall your 9.0.1 version. To do so, execute the following commands:

    cd /Library/Java/JavaVirtualMachines/
    ls -l
    

    Identify the folder containing your Java Version, then remove it

    sudo rm -rf jdk.x.x_xxx.jdk
    

    After that you can download and install java 8 from oracle again. Refer to jdk8 download page

    0 讨论(0)
提交回复
热议问题