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

前端 未结 11 1713
悲&欢浪女
悲&欢浪女 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 04:12

    I was getting this error, but for a more recent version of Java - 10.0.2.

    To fix my error, I followed the steps mentioned by @Blacktoviche in this Github issue: https://github.com/facebook/react-native/issues/17688

    When I opened the android folder inside my project via Android Studio, I was prompted with Android Gradle plugin update recommended. At the time, I was following a slightly outdated tutorial that told me to click Don't remind me again for this project.

    However, as @Blacktoviche recommended in the github issue linked above, sometimes it's necessary to update the Gradle plugin. After updating, I also had to click Install Build Tools 27... and sync project (I don't remember the exact version).

    After I followed these steps, I was able to successfully run my react native app on the Android Studio emulator.

    Hope this helps someone!

提交回复
热议问题