vallllll vallllll - 9 months ago 70
Android Question

Android Studio lint.xml configuration

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"?>
<issue id="UnusedResources">
<ignore path="res/drawable/background_palette_drawable_6.xml" />

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

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
is found correctly but maybe something is wrong with the path?

Answer Source

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