Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not find com.android.tools.lint:lint-gradle:26.1.1

Tags:

android

While generating APK, It's showing build failed, this is the error message :

    Could not find com.android.tools.lint:lint-gradle:26.1.1.
Searched in the following locations:
    file:/C:/Users/Abde/AppData/Local/Android/Sdk/extras/m2repository/com/android/tools/lint/lint-gradle/26.1.1/lint-gradle-26.1.1.pom
    file:/C:/Users/Abde/AppData/Local/Android/Sdk/extras/m2repository/com/android/tools/lint/lint-gradle/26.1.1/lint-gradle-26.1.1.jar
    file:/C:/Users/Abde/AppData/Local/Android/Sdk/extras/google/m2repository/com/android/tools/lint/lint-gradle/26.1.1/lint-gradle-26.1.1.pom
    file:/C:/Users/Abde/AppData/Local/Android/Sdk/extras/google/m2repository/com/android/tools/lint/lint-gradle/26.1.1/lint-gradle-26.1.1.jar
    file:/C:/Users/Abde/AppData/Local/Android/Sdk/extras/android/m2repository/com/android/tools/lint/lint-gradle/26.1.1/lint-gradle-26.1.1.pom
    file:/C:/Users/Abde/AppData/Local/Android/Sdk/extras/android/m2repository/com/android/tools/lint/lint-gradle/26.1.1/lint-gradle-26.1.1.jar
    https://jcenter.bintray.com/com/android/tools/lint/lint-gradle/26.1.1/lint-gradle-26.1.1.pom
    https://jcenter.bintray.com/com/android/tools/lint/lint-gradle/26.1.1/lint-gradle-26.1.1.jar
Required by:
    project :app

Help me ! thank you

like image 625
Alex Bene Avatar asked Apr 29 '18 09:04

Alex Bene


1 Answers

If you're running lint on a project that you created using an older version of Android Studio, you may encounter this error.

Your top-level project build.gradle ought to have the google() repository in order to fetch this dependency like this:

allprojects {
    repositories {
        // The order in which you list these repositories matter.
        google()
        jcenter()
    }
}

Note that: The google() repo is a shortcut to looks in Google's Maven repository for dependencies. It was introduced with Gradle v.4.0 (required Android Studio 3.x and Gradle plugin 3.x).

In any case (Android Studio 2.x, gradle plugin 2.x.x, or gradle v3.x) you can use the same maven repo using maven { url 'https://maven.google.com' }. It is the same.

like image 95
nhoxbypass Avatar answered Sep 20 '22 15:09

nhoxbypass