java - 错误:找不到 com.android.tools.build:gradle:3.2.1
问题描述
当我想打开或运行项目时,出现以下错误:
ERROR: Could not find com.android.tools.build:gradle:3.2.1.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.2.1/gradle-3.2.1.pom
- https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.2.1/gradle-3.2.1.jar
- https://jcenter.bintray.com/com/android/tools/build/gradle/3.2.1/gradle-3.2.1.pom
- https://jcenter.bintray.com/com/android/tools/build/gradle/3.2.1/gradle-3.2.1.jar
Required by:
project :
Open File
这是我的 build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.3.50'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
同样默认情况下,它包含谷歌回购但错误在那里。我在 ubuntu 19.1 上运行,并按照说明进行操作,但不幸的是我无法解决这个问题。感谢社区。
解决方案
我记得遇到过这样的问题,然后惊讶地发现我有网络问题!
以下步骤可能对您有所帮助: - 检查您的系统代理设置。- 然后,文件 -> 无效的 Cashes/Restart。
推荐阅读
- ios - UICollectionViewCompositionalLayout 正交部分 willDisplayCell 分析
- c++ - 在主类中调用保护函数
- python - 使用 Python 脚本发送电子邮件
- mongodb - 使用MongoDB获取数组中值的键值聚合?
- hadoop - 用于基于多列比较在 hive 中创建条件 sql 查询
- jsf - 警告:此页面调用 XML 命名空间 http://primefaces.org/ui/extensions 声明,前缀为 pe,但该命名空间不存在标记库
- macos - 有什么方法可以在 AppleScript 中暂时暂停脚本?
- git - Unity .gitignore 不忽略 .asset 文件
- python - 这种递归二分搜索是如何工作的?用于查找 bst 中的第 k 个最小节点
- javascript - 带有 4 位小数的货币格式正则表达式,如果没有则不显示美分