Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not find com.android.tools.lint:lint-gradle Android Studio 3

I have updated Android Studio to 3.0 and now received a lot of issues.. now stoped on point with such issue:

Could not resolve all files for configuration ':applib:_lintClassPath'. > Could not find com.android.tools.lint:lint-gradle:26.1.0-alpha01.   Searched in the following locations:       file:/Users/anwender/Library/Android/sdk/extras/m2repository/com/android/tools/lint/lint-gradle/26.1.0-alpha01/lint-gradle-26.1.0-alpha01.pom       file:/Users/anwender/Library/Android/sdk/extras/m2repository/com/android/tools/lint/lint-gradle/26.1.0-alpha01/lint-gradle-26.1.0-alpha01.jar       file:/Users/anwender/Library/Android/sdk/extras/google/m2repository/com/android/tools/lint/lint-gradle/26.1.0-alpha01/lint-gradle-26.1.0-alpha01.pom       file:/Users/anwender/Library/Android/sdk/extras/google/m2repository/com/android/tools/lint/lint-gradle/26.1.0-alpha01/lint-gradle-26.1.0-alpha01.jar       file:/Users/anwender/Library/Android/sdk/extras/android/m2repository/com/android/tools/lint/lint-gradle/26.1.0-alpha01/lint-gradle-26.1.0-alpha01.pom       file:/Users/anwender/Library/Android/sdk/extras/android/m2repository/com/android/tools/lint/lint-gradle/26.1.0-alpha01/lint-gradle-26.1.0-alpha01.jar       https://jcenter.bintray.com/com/android/tools/lint/lint-gradle/26.1.0-alpha01/lint-gradle-26.1.0-alpha01.pom       https://jcenter.bintray.com/com/android/tools/lint/lint-gradle/26.1.0-alpha01/lint-gradle-26.1.0-alpha01.jar       https://jitpack.io/com/android/tools/lint/lint-gradle/26.1.0-alpha01/lint-gradle-26.1.0-alpha01.pom       https://jitpack.io/com/android/tools/lint/lint-gradle/26.1.0-alpha01/lint-gradle-26.1.0-alpha01.jar       file:/Users/anwender/dev/project/dk_shopping_checklist/augmented/libs/lint-gradle-26.1.0-alpha01.jar       file:/Users/anwender/dev/project/dk_shopping_checklist/augmented/libs/lint-gradle.jar   Required by:       project :applib 

Does someone know what the issue can be?

Gradle.build:

apply plugin: 'com.android.library'  android {     compileSdkVersion 26     buildToolsVersion '26.0.2'     defaultConfig {         minSdkVersion 24         targetSdkVersion 26     }      buildTypes {         release {             minifyEnabled false             proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'         }     } }  dependencies {     implementation fileTree(include: ['*.jar'], dir: 'libs')     implementation 'com.android.support:appcompat-v7:+' } 

I'm using latest gradle version: "gradle-4.2.1-all.zip".

like image 446
D.K. Avatar asked Oct 27 '17 09:10

D.K.


People also ask

How to enable lint in Android Studio?

Configuring lint checking in Java and XML source files Tip: If you are using Android Studio, you can use the File > Settings > Project Settings > Inspections feature to manage the lint checking to your Java or XML source files.

How to disable lint in Android Studio?

To suppress a lint warning with a comment, add a //noinspection id comment on the line before the statement with the error. Here we specify a comma separated list of issue id's after the disable command. You can also use warning or error instead of disable to change the severity of issues.

How to run lint check?

Lint checks are automatically performed by the Gradle build system. To see the available checks in Android Studio File Settings Editor Inspections. You can also run the lint checks manually by right-clicking on your project and select Analyze Inspect Code. You can run link also from the command line.

What is lint error in Android?

Android Studio provides a code scanning tool called lint that can help you to identify and correct problems with the structural quality of your code. For example, Lint can help us clean up these issues. XML resource files containing unused namespaces. Use of deprecated elements.


1 Answers

If you're running lint on a project that you created using an older version of Android Studio, you may encounter this error.

To resolve this issue, for each project that you would like to run lint on, include Google's Maven repository in the top-level build.gradle file, as shown below:

allprojects {     repositories {         // The order in which you list these repositories matter.         google()         jcenter()     } } 
like image 169
0xAliHn Avatar answered Oct 08 '22 12:10

0xAliHn