couldn't locate lint-gradle-api-26.1.2.jar for flutter project

  • A+
Category:Languages

I'm new to Flutter and trying to run the example project when you create a new one. When trying to run it, I have this issue:

FAILURE: Build failed with an exception.

I understand it's trying to get the file "lint-gradle-api-26.1.2.jar" from the jcenter repository but when following the link I get this:

{   "errors" : [ {     "status" : 404,     "message" : "Could not find resource"   } ] } 

So I added the google repository in my build.gradle file:

buildscript {     repositories {         maven { url 'https://dl.google.com/' }         google()         jcenter()     } 

and I also succeed to get the file by following this link: https://dl.google.com/dl/android/maven2/com/android/tools/lint/lint-gradle-api/26.1.2/lint-gradle-api-26.1.2.jar but I'm still getting the same error when trying to run my project whether it is by using VS Code, Android Studio or with the CLI.

Does anyone know how to force Gradle to download the file from the link I've found?

Here's how my build.gradle file looks like:

buildscript {     repositories {         //maven { url 'https://dl.google.com/dl/android/maven2/com/android/tools/lint/lint-gradle-api/26.1.2/lint-gradle-api-26.1.2.jar' }         repositories {             google()             maven { url 'https://maven.fabric.io/public' }             mavenCentral()             jcenter()         }     }      dependencies {         classpath 'com.android.tools.build:gradle:3.1.2'     } }  allprojects {     repositories {         google()         maven { url 'https://maven.fabric.io/public' }         mavenCentral()         jcenter()     } }  repositories {     google()     maven { url 'https://maven.fabric.io/public' }     mavenCentral()     jcenter() }  .... 

 


Modify flutter.gradle under ./flutter/packages/flutter_tools/gradle to upgrade the tools version to 3.2 .1 and add goole() to the first line enter image description here

Comment

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: