React Native FAILURE:构建失败,发生异常。无法解析':classpath'。找不到com.android.tools.build:gradle:3.0.1 [英] React Native FAILURE: Build failed with an exception. Could not resolve ':classpath'. Could not find com.android.tools.build:gradle:3.0.1
问题描述
当我输入命令 react-native run-android时,它发生了:
失败:生成失败,出现异常。
- 出了什么问题:
配置根项目 AsomeProject时出现问题。
无法解析配置:classpath的所有文件。
找不到com.android.tools.build:gradle:3.0.1。
在以下位置搜索:
解决方案我遇到了同样的问题,我尝试了 Manoj Prabhakar的解决方案,但我修复了一个将
$ b $的buildscript块中bgoogle()
存储库放入项目级别build.gradle
buildscript {
存储库{
jcenter()
google()
}
依赖项{
classpath'com.android.tools.build:gradle:3.0.1'
}
}
When I make the command "react-native run-android" then it happened:
FAILURE: Build failed with an exception.
- What went wrong:
A problem occurred configuring root project 'AsomeProject'.
Could not resolve all files for configuration ':classpath'. Could not find com.android.tools.build:gradle:3.0.1. Searched in the following locations: https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.1/gradle -3.0.1.pom https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.1/gradle -3.0.1.jar
screenshot:
解决方案I had the same problem, I tried Manoj Prabhakar's solution but I fixed adding the
google()
repository to the buildscript block in the project levelbuild.gradle
buildscript { repositories { jcenter() google() } dependencies { classpath 'com.android.tools.build:gradle:3.0.1' } }
这篇关于React Native FAILURE:构建失败,发生异常。无法解析':classpath'。找不到com.android.tools.build:gradle:3.0.1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
- What went wrong:
A problem occurred configuring root project 'AsomeProject'.