Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

“Obsolete custom lint check” from `androidx.appcompat.AppCompatIssueRegistry` which requires a newer API level

I’ve got a project in which I get the following Android lint warning:

Obsolete custom lint check

../../../../../../../.gradle/caches/transforms-2/files-2.1/fc4398fa701898f50fcec85691d33578/appcompat-1.2.0/jars/lint.jar: Lint found an issue registry (androidx.appcompat.AppCompatIssueRegistry) which requires a newer API level. That means that the custom lint checks are intended for a newer lint version; please upgrade Lint can be extended with "custom checks": additional checks implemented by developers and libraries to for example enforce specific API usages required by a library or a company coding style guideline.

The Lint APIs are not yet stable, so these checks may either cause a performance degradation, or stop working, or provide wrong results.

This warning flags custom lint checks that are found to be using obsolete APIs and will need to be updated to run in the current lint environment.

It may also flag issues found to be using a newer version of the API, meaning that you need to use a newer version of lint (or Android Studio or Gradle plugin etc) to work with these checks. To suppress this error, use the issue id "ObsoleteLintCustomCheck" as explained in the Suppressing Warnings and Errors section.

ObsoleteLintCustomCheck Warning Priority 10/10

I have no idea what that even means, I don’t use any custom lint thingies. It also only occurs in the app module, not in a library module.

I had just bumped my project from API 26 to 30 and switched to AndroidX/JetPack.

To reproduce it, clone the project, check out commit 96273fd8b1af5d5c63603b7df71e0849f518a9e5, change to the android/ subdirectory and run ./gradlew lint. I’ve got no idea whether this can be reduced or how (I’m new to Android development, cursing the sky red about issues with it, having been developing software since the later 1980s).

like image 641
mirabilos Avatar asked Dec 28 '20 14:12

mirabilos


1 Answers

The issue is caused by the lint checks which are included in the appcompat dependency in your app module. The lint checks were compiled using old API as is said in the message of the warning.

There are two ways how you can resolve it.

  1. Update to latest version 1.3.0-beta01

    implementation 'androidx.appcompat:appcompat:1.3.0-beta01'
  2. Suppress the lint warning in the lintOptions block

    
    android {
        lintOptions {
            disable 'ObsoleteLintCustomCheck'
        }
    }
    
like image 169
PRE Avatar answered Nov 05 '22 13:11

PRE