Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I have updated Android Studio to 3.2.1 and now stoped on point with such issue: 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

I have tried to reorder my build.gradle file. Still, you can find the attachment here.

I have tried all the solutions.

I know this question has duplicates but their solution is not working. enter image description here

like image 379
Jay Poojara Avatar asked Oct 25 '18 06:10

Jay Poojara


1 Answers

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

like image 152
M.Ricciuti Avatar answered Oct 27 '22 10:10

M.Ricciuti