首页 > 解决方案 > 错误:找不到 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 上运行,并按照说明进行操作,但不幸的是我无法解决这个问题。感谢社区。

标签: javaandroidkotlinflutterdart

解决方案


我记得遇到过这样的问题,然后惊讶地发现我有网络问题!

以下步骤可能对您有所帮助: - 检查您的系统代理设置。- 然后,文件 -> 无效的 Cashes/Restart。


推荐阅读