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