Couldn't Locate Lint-Gradle-Api-26.1.2.Jar for Flutter Project

Couldn't locate lint-gradle-api-26.1.2.jar for Flutter project

I solved the problem by moving:

maven {
url 'https://dl.google.com/dl/android/maven2'
}

in the top of:

jcenter()

in the file: .flutter/packages/flutter_tools/gradle/flutter.gradle:

    buildscript {
repositories {
maven {
url 'https://dl.google.com/dl/android/maven2'
}
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.2'
}
}

Facing the issue while gradle sync - Could not find lint-gradle-api.jar (com.android.tools.lint:lint-gradle-api:26.1.2)

There were lots of similar issues raised the past days, that could be solved by adding the google() repository in first position in the repositories block of the build scripts.
See detailed explanation in the following answers:

  • couldn't locate lint-gradle-api-26.1.2.jar for flutter project
  • Could not find play-services-basement.aar
  • https://stackoverflow.com/a/52982816/6899896
  • Could not find com.android.tools.build:aapt2:3.2.0

The root cause , related to missing libraries in Jcenter, is explained in detail here : https://stackoverflow.com/a/50885939/6899896

Note see https://stackoverflow.com/a/52947028/6899896 : you need to modify .flutter/packages/flutter_tools/gradle/flutter.gradle in addition to your project's build scripts (module & app levels) to set repo google() first and jcenter() last

showing this Gradle error when trying to run flutter project

The gradle plugin has different versions in project level build.grade and gradle-wrapper.properties Here is the official documentation about this

Android Studio Error lint-gradle-api-26.1.2 not found

I ran into this issue as well.  Basically, the issue is that mentioned jar file is no longer in jcenter.  I resolved by changing the order of search in our app build.gradle:

buildscript {
repositories {
maven {
url 'https://dl.google.com/dl/android/maven2'
}
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.2'
}
}

allprojects {
repositories {
google()
jcenter()
}
}


Related Topics



Leave a reply



Submit