문제

I have an Android project that includes generated code. This code has some lint violations in it that I don't want to show up in the lint reports because we won't fix this code problems manually.

Is it somehow possible to exclude folders in the lint check?

도움이 되었습니까?

해결책 2

Add to your project 'lint.xml' file with content as such:

<?xml version="1.0" encoding="UTF-8"?>
<lint>
    <ignore path="build" />
</lint>

for example to ignore build path of that project.

다른 팁

The correct way to do this is to add the following block to your app's lint.xml (this file is by default placed at the root of your app module):

<issue id="all">
    <ignore path="build" />
</issue>

This will instruct Lint to ignore all issues for the specified folder. If there is no lint.xml in your app module folder, create one with the following content:

<?xml version="1.0" encoding="UTF-8"?>
<lint>
    <issue id="all">
        <ignore path="build" />
    </issue>
</lint> 

I had to specify the issue id as well as the ignored path. The ignore path alone didn't work. Example with http://tools.android.com/tips/lint-checks lint check:

<?xml version="1.0" encoding="UTF-8"?>
<lint>
    <issue id="MissingTranslation">
        <ignore path="build"/>
    </issue>
</lint>

You can find the issue id list here. Your lint.xml is placed in your project directory.

Example:

./app/lint.xml
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top