Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Suppress lint warning about available Support Library preview versions

I recently updated the Support Library repository on my computer, and it came with version 24.0.0-alpha1 of the Support Library.

Since this is a preview release, I don't want to use that version yet and want to stick with 23.2.1. However, lint now flags all of my support library dependencies as being out of date.

How can I tell lint to ignore alpha and beta versions?

like image 255
Bryan Herbst Avatar asked Nov 02 '25 17:11

Bryan Herbst


1 Answers

The first step is to create a lint.xml file if you do not already have one. This file should be in your modules root, for example at app/lint.xml.

You can use this file to customize lint's behavior in a number of ways, such as changing severity levels of specific checks or excluding some checks.

When choosing to ignore a check, you can specify a regular expression that will ignore any warnings with a message that matches the expression.

For an out of date support library version, the message will look something like this:

A newer version of com.android.support:support-v4 than 23.2.1 is available: 24.0.0-alpha1

Thus the following lint.xml file will ignore out of date warnings for any dependency with an available alpha or beta version:

<?xml version="1.0" encoding="utf-8"?>
<lint>
    <!-- Don't warn about available alpha versions -->
    <issue id="GradleDependency">
        <ignore regexp="is available: .*[alpha|beta]" />
    </issue>
</lint>
like image 199
Bryan Herbst Avatar answered Nov 04 '25 09:11

Bryan Herbst