Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio lint.xml configuration

Tags:

android

xml

lint

I would like to configure lint in Android Studio to ignore some file. I have placed the lint.xml file in app/ folder. Here is the content of the lint file:

<?xml version="1.0" encoding="UTF-8"?>
<lint>
    <issue id="UnusedResources">
        <ignore path="res/drawable/background_palette_drawable_6.xml" />
    </issue>
</lint>

When I run lint to check for unused resources it still finds this file as unused.

In app build.gradle I have:

lintOptions {
    disable 'InvalidPackage'
    abortOnError false
    absolutePaths false
    lintConfig file('lint.xml')
}

I have tried changing the file path to /app/src/main/res/drawable/background_palette_drawable_6.xml and still it does not work.

I put <issue id="UnusedResources" severity="ignore"> and in that case it just ignores all the unused resources so it seems the file lint.xml is found correctly but maybe something is wrong with the path?

like image 205
vallllll Avatar asked Jan 20 '16 09:01

vallllll


1 Answers

Consider using path="**/background_palette_drawable_6.xml" with the ** glob pattern to match the file regardless of its location.

like image 133
laalto Avatar answered Nov 10 '22 22:11

laalto