当安装'react-native init AwesomeProject'时,我在运行时收到此错误react-native run-android
:
Could not determine java version from '11.0.1'.
一个快速的谷歌建议我需要distributionUrl
在Gradle-wrapper中更新。完成此操作后,我面临一个新错误:
Cannot add task 'wrapper' as a task with that name already exists.
这表明问题出在文件中:
/AwesomeProject/android/build.gradle' line: 36
看起来像这样
task wrapper(type: Wrapper) {
gradleVersion = '4.4'
distributionUrl = distributionUrl.replace("bin", "all")
}
我一直来回地试图弄清楚这是怎么做的。某些东西开箱即用似乎很奇怪。是否有人面临类似的问题?