friederbluemle friederbluemle - 1 year ago 80
Android Question

How to suppress Android Lint warning in Gradle script

I have the following annoying warning in my Android Lint report:

Gradle Dependency: Obsolete Gradle Dependency
A newer version of than 20.+ is available: 21.0.0-rc1

The problem is I cannot use 21.0.0-rc1 because it does not work with my project. How can I suppress the warning?

Answer Source

You can disable lint warnings in Gradle. In this case:

android {

    lintOptions {
        disable 'GradleDependency'


To disable the warning for a specific dependency, you can instead use the noinspection hint just above the line that causes the warning. Like this:

//noinspection GradleDependency
compile ''

In Android Studio, you can turn off the "Obsolete Gradle Dependency" warning in Settings -> Project Settings -> Inspections.

enter image description here