且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Gradle:列出不推荐使用的功能

更新时间:2023-11-10 13:19:10

我只是遇到了完全相同的问题,并且每次通过命令行运行Gradle构建任务对我来说都不是***选择,因为在开发过程中,我通常只使用内置的Gradle构建任务运行,所以:

I just faced the exact same problem and running the Gradle build task every time through the command line wasn't the best option for me because, during development, I usually just use the built-in Gradle build task run, so:

我知道我可以转到Gradle文档中,看看现在不赞成使用的东西,我特别想要的是一种检查我的代码并列出我不赞成使用的功能的方法.

I know I can go to the Gradle documentation and see what is now deprecated, what I would specifically like is a way to go through MY code and list out MY deprecated features.

您可以通过在Android Studio设置的gradle命令行选项中添加提到的-warning-mode = all 标志来实现此目的:

You can do this by adding the mentioned --warning-mode=all flag to your gradle command line options in your Android Studio settings:

这样会打印出适当的警告,以提醒您您的应用正在使用的特定不推荐使用的功能.

This will print the proper warnings for you to be aware of what are the specific deprecated features your app is using.

另外,我知道您在一年前就问过这个问题,但是,这对于面临相同问题的其他人可能很有用.

Also, I know you asked this near a year ago, but, it might be useful for other people facing the same issue.