发布于 4年前

解决Gradle4.1报错:Could not determine java version from '9.0.1'.

执行

react-native run-android

gradle版本: 4.1
jdk:9.0.1

报错:

Starting JS server...
Building and installing the app on the device (cd android && ./gradlew installDebug)...

FAILURE: Build failed with an exception.

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

解决方法:

升级到最新版本Gradle 4.3-rc-2可以解决。

找到项目的gradle-wrapper.properties文件,路径如下

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

distributionUrl修改如下:

distributionUrl=https\://services.gradle.org/distributions/gradle-4.3-rc-2-all.zip
©2020 edoou.com   京ICP备16001874号-3