Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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:

  • https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/4.0.0/gradle-4.0.0.pom

  • https://jcenter.bintray.com/com/android/tools/build/gradle/4.0.0/gradle-4.0.0.pom

like image 223
pedram amini Avatar asked Dec 07 '22 10:12

pedram amini


1 Answers

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.

like image 139
ralphchan Avatar answered Dec 29 '22 07:12

ralphchan