Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

could not find com.android.tools.build.gradle:4.6

Tags:

gradle

Im trying to run an app I wrote in a diffrent computer and I get this error:

Error:Could not find com.android.tools.build:gradle:4.6. Searched in the following locations: file:/C:/Program Files/Android/Android Studio1/gradle/m2repository/com/android/tools/build/gradle/4.6/gradle-4.6.pom file:/C:/Program Files/Android/Android Studio1/gradle/m2repository/com/android/tools/build/gradle/4.6/gradle-4.6.jar https://jcenter.bintray.com/com/android/tools/build/gradle/4.6/gradle-4.6.pom https://jcenter.bintray.com/com/android/tools/build/gradle/4.6/gradle-4.6.jar https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/4.6/gradle-4.6.pom https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/4.6/gradle-4.6.jar Required by: project : Open File

I've Updated anything I could think of but nothing works. Thank you!

like image 757
Amit Avatar asked Mar 24 '18 18:03

Amit


1 Answers

Please give more contextual information.

Since I lack these information, I can only make a guess: did you specify the new google() maven repository in your project build.gradle file?

buildscript {
    repositories {
        ...
        google() // this replace https://maven.google.com
        ...
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.0'
    }
}

If you need google() repository in your module(s), you can also add this in your project build.gradle file

allprojects {
    repositories {
        ...
        google()
        ...
    }
}
like image 130
Pascal Avatar answered Oct 05 '22 18:10

Pascal