mohammad
mohammad

Reputation: 2910

ERROR: Could not find com.android.tools.build:gradle:3.2.1

when I want to open or run a project , I get error below :

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

and this is my 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
}

also by deffault , it contains google repo but the error is there . I am running on ubuntu 19.1 , and follow the instructions but unfortunetly I can not solve this. Thanks to Community.

Upvotes: 4

Views: 7354

Answers (3)

Soli
Soli

Reputation: 87

I remember facing such problems, and surprisingly found out that I have network problem!

Here are steps may help you: - check your system proxy settings. - then, File -> invalid Cashes/Restart.

Upvotes: 4

shubh
shubh

Reputation: 31

clear gradle cache

rm -rf $HOME/.gradle/caches

and resync to download all dependencies

Go Settings/Gradle/Android Studio. Then check "Enable embedded Maven repository". And you're good to go.

Upvotes: 3

Luiz Mash
Luiz Mash

Reputation: 41

Try classpath 'com.android.tools.build:gradle:3.5.3'

also an unrelated addition, Kotlin is -> ext.kotlin_version = '1.3.61'

Upvotes: 2

Related Questions