3

I've downloaded a new android project and for some reason I get this error when I am trying to build the app:

Could not find lint-checks.jar (com.android.tools.lint:lint-checks:26.0.1). Searched in the following locations: https://jcenter.bintray.com/com/android/tools/lint/lint-checks/26.0.1/lint-checks-26.0.1.jar

Weirdly, when I go to that url I can download the jar, so i'm really unsure why Android studio is complaining. I've downloaded the latest version - 3.1.2.

I've also tried disabling lint but no luck with removing the error!

Any help would be greatly appreciated!

My gradle file:

buildscript {
    repositories {
        jcenter()
        mavenCentral()
        google()
        maven { url 'https://maven.fabric.io/public' }
        maven { url 'http://oss.jfrog.org/artifactory/oss-snapshot-local' }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.1'
        //noinspection GradleDynamicVersion
        classpath 'io.fabric.tools:gradle:1.+'
        classpath 'com.google.gms:google-services:3.1.2'
        classpath 'com.android.tools.lint:lint-checks:26.0.1'
        classpath 'com.github.ben-manes:gradle-versions-plugin:0.17.0'
        classpath "io.realm:realm-gradle-plugin:4.3.3"
    }
}


allprojects {
    repositories {
        google()
        jcenter()
        mavenCentral()
        google()
        maven { url "https://jitpack.io" }
        maven { url 'https://maven.fabric.io/public' }
        maven { url "https://dl.bintray.com/drummer-aidan/maven" }
        flatDir {
            dirs '../aars'
        }
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}
Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
LifeQuestioner
  • 406
  • 5
  • 14
  • Possible duplicate of [Gradle build tool cannot find play-services-tasks.aar? Why?](https://stackoverflow.com/questions/50562212/gradle-build-tool-cannot-find-play-services-tasks-aar-why) – Floern May 28 '18 at 13:16
  • 2
    To be precise, swap `jcenter()` and `google()` in the `buildscript { repositories { .. } }` block. – Floern May 28 '18 at 13:18
  • @Floern this worked!!! THANKYOU. Why does this work? :S – LifeQuestioner May 28 '18 at 13:31

2 Answers2

1

I also started getting this issue this morning. I had not updated anything, not really sure what changed over the weekend.

I managed to fix the issue by updating my buildToolsVersion from 26.0.2 to 27.0.3, which also required me to update my Gradle version from 4.3 to 4.4 and my Gradle Plug-in from 3.0.1 to 3.1.2.

This was before I saw the solution provided by Floern, which also works. Not sure why though and i figured it's always better to stay up to date with the latest versions of Gradle.

Sipea
  • 11
  • 1
  • Updating the versions of build tools, Gradle and Gradle plug-in did not work for me. Putting google() first in the repositories block was the solution for me. – Kai Jun 08 '18 at 09:36
0

try to add "com.android.tools.lint:lint-checks:26.0.1" to your gradle dependencies

cloud15
  • 1
  • 2