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
Using Global Exception Handling on Android
How to Make Alarm Manager Work When Android 6.0 in Doze Mode
Using Contextmenu with Listview in Android
Android M Permissions:Confused on the Usage of Shouldshowrequestpermissionrationale() Function
Any Way to Run Shell Commands on Android Programmatically
Android: Clear Cache of All Apps
Lost My Keystore for Uploaded App on Android Market
HTML Email Looking Different in Gmail App
Error:'Keytool' Is Not Recognized as an Internal or External Command, Operable Program or Batch File
Google Signin Not Working in Release Mode APK Android
Intent Action for Network Events in Android Sdk
Android Parcelable -- Retailerorderactivity.Java Return Null
Fade in Fade Out Android Animation in Java
How to Rename the Android Package Name
How to Find If a Particular Package Exists on My Android Device
Upload Photo to Facebook with Facebook Android Sdk in Android