close

Could not resolve all files for configuration ‘classpath’. Could not find lint-gradle-api.jar

Hello Guys how are you all ? Hope You all are fine. When I am trying to run the example project, I have this issue:

How Could not resolve all files for configuration ‘classpath’. Could not find lint-gradle-api.jar Error occur?

FAILURE: Build failed with an exception

Could not resolve all files for configuration ‘classpath’. Could not find lint-gradle-api.jar (com.android.tools.lint:lint-gradle-api:26.1.2). Searched in the following locations: https://jcenter.bintray.com/com/android/tools/lint/lint-gradle-api/26.1.2/lint-gradle-api-26.1.2.jar

it’s trying to get the file “lint-gradle-api-26.1.2.jar” from the jcenter repository but it Could not find resource. and through this below error.

Could not resolve all files for configuration ‘classpath’. Could not find lint-gradle-api.jar (com.android.tools.lint:lint-gradle-api:26.1.2). Searched in the following locations: https://jcenter.bintray.com/com/android/tools/lint/lint-gradle-api/26.1.2/lint-gradle-api-26.1.2.jar

How to solve Could not resolve all files for configuration ‘classpath’. Could not find lint-gradle-api.jar?

  1. How to solve Could not resolve all files for configuration 'classpath'. Could not find lint-gradle-api.jar?

    to solve Could not resolve all files for configuration 'classpath'. Could not find lint-gradle-api.jar Just Modify flutter.gradle under ./flutter/packages/flutter_tools/gradle to upgrade the tools version to 3.2.1 and add google() to the first line:

  2. Could not resolve all files for configuration 'classpath'. Could not find lint-gradle-api.jar

    to solve Could not resolve all files for configuration 'classpath'. Could not find lint-gradle-api.jar Just Modify flutter.gradle under ./flutter/packages/flutter_tools/gradle to upgrade the tools version to 3.2.1 and add google() to the first line:

Solution 1 : update flutter.gradle file.

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'
    }
}

Solution 2 : Modify flutter.gradle

Modify flutter.gradle under ./flutter/packages/flutter_tools/gradle to upgrade the tools version to 3.2.1 and add google() to the first line:

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

Solution 3 : changed this line in the build.gradle file

Regarding this error, I just changed this line in the build.gradle file:

classpath 'com.android.tools.build:gradle:3.1.2'

to:

classpath 'com.android.tools.build:gradle:3.1.3'

And that solved my problem.

Solution 4 : flutter upgrade

This is related to Flutter 0.9.4 at the moment. It will be fixed in the next release. In the meantime, you can update Flutter manually by running the commands described in “Flutter Upgrade”. Basically they involve the following:

  1. Change the Flutter GitHub channel to master by running on the command prompt:flutter channel master
  2. Upgrade Flutter itself by runningflutter upgrade

Once the upgrade is done, run the test drive application, and it should compile successfully.

Summery

So Hope This Above 3 Solution Will Work For You Too. So it’s all About Couldn’t locate lint-gradle-api-26.1.2.jar for Flutter project error. Hope this tutorial helped you a lot. Comment below Your thoughts and your queries. And Also Comment on your suggestion here.

Also Check Out Below Tutorials

Leave a Comment

%d bloggers like this: