Lasitha Nipun Dilshan
Lasitha Nipun Dilshan

Reputation: 85

Cannot resolve external dependency com.android.tools.build:gradle:4.0.1 because no repositories are defined

I try to open the code set but it's not open. show below error.How to fix it

Cannot resolve external dependency com.android.tools.build:gradle:4.0.1 because no repositories are defined.

enter image description here

enter image description here

Upvotes: 5

Views: 7505

Answers (1)

Gabriele Mariotti
Gabriele Mariotti

Reputation: 365038

In your buildscript block you have to add the repositories also.
Something like:

buildscript {
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:4.1.0'
    }
}

Upvotes: 6

Related Questions