Android lint 不报告弃用的依赖项

问题描述 投票:0回答:1

如果我用

@Deprecated
标记某些类或函数,我希望 Lint 将此类的所有用法报告为警告,但是我在 Lint html 报告中看不到任何与弃用用法相关的内容。

我试过设置

<issue id="Deprecated" severity="warning" />

在 lint.xml 配置文件中,但没有帮助。

android lint
1个回答
0
投票

Android Lint 不支持检测弃用的用法。使用 Android Studio 或 IntelliJ IDEA 获取已弃用代码的警告。在 Inspections 设置中启用“Java | Code issues | Usage of deprecated members”。或者,使用第三方工具,如 Checkstyle 或 Error Prone。

© www.soinside.com 2019 - 2024. All rights reserved.