gpt4 book ai didi

android - “Obsolete custom lint check” 来自 `androidx.appcompat.AppCompatIssueRegistry`,这需要更新的 API 级别

转载 作者:行者123 更新时间:2023-12-03 16:19:46 25 4
gpt4 key购买 nike

我有一个项目,其中我收到以下 Android lint 警告:

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 upgradeLint 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


我什至不知道这意味着什么,我不使用任何定制的 lint thingies。它也只出现在应用程序模块中,而不是库模块中。
我刚刚碰到了 my project从 API 26 到 30 并切换到 AndroidX/JetPack。
要重现它,请克隆项目,查看 commit 96273fd8b1af5d5c63603b7df71e0849f518a9e5 , 改为 android/子目录并运行 ./gradlew lint .我不知道这是否可以减少或如何减少(我是 Android 开发的新手,诅咒它的问题,自 1980 年代后期以来一直在开发软件)。

最佳答案

该问题是由 appcompat 中包含的 lint 检查引起的。应用程序模块中的依赖项。如警告消息中所述,lint 检查是使用旧 API 编译的。
有两种方法可以解决它。

  • 更新到最新版本 1.3.0-beta01
    implementation 'androidx.appcompat:appcompat:1.3.0-beta01'
  • 抑制 lintOptions 中的 lint 警告堵塞

    android {
    lintOptions {
    disable 'ObsoleteLintCustomCheck'
    }
    }
  • 关于android - “Obsolete custom lint check” 来自 `androidx.appcompat.AppCompatIssueRegistry`,这需要更新的 API 级别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65479506/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com