pedram amini
pedram amini

Reputation: 149

Could not find com.android.tools.build:gradle:4.0.0

gradle-wrapper.properties

distributionBase=GRADLE_USER_HOME

distributionPath=wrapper/dists

distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip

zipStoreBase=GRADLE_USER_HOME

zipStorePath=wrapper/dists

gradle-wrapper

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {

    repositories {

        google()

        jcenter()

    }

    dependencies {

        classpath "com.android.tools.build:gradle:4.0.0"

        // 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

}

Could not find com.android.tools.build:gradle:4.0.0.

Searched in the following locations:

Upvotes: 4

Views: 10679

Answers (2)

Ranjitha Ravi
Ranjitha Ravi

Reputation: 1

I faced this issue after Invalidating caches under File -> Invalidate Cache/Restart Later deleted node_modules under project folder and then did an npm install. On Click of File -> Sync Project with Gradle Files resolved this issue

Upvotes: 0

ralphchan
ralphchan

Reputation: 411

I struggled in a similar question after upgrading the Android Gradle Plugin Version from 3.3.0 to 4.0.0 of a React Native project as suggested by Android Studio. I followed the answer but it still do not sync correctly.

Finally I run rm -rf node_modules and re-install all the dependencies by npm install. After that I sync again and it sync correctly. I guess that there are some caches in different node modules that are not cleaned properly. I hope if someone encounter similar problem can try and see if my answer fix the problem.

Upvotes: 14

Related Questions