Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ignore several warnings in Android lint

Tags:

I know I can ignore a rule in Lint with attribute tools:ignore

My difficulty is that I want to ignore several rules. In my case, for Google analytics ga_trackingId, I want to ignore TypographyDashes and MissingTranslation

I tried with no success

<resources tools:ignore="TypographyDashes|MissingTranslation" xmlns:tools="https://schemas.android.com/tools" > 

and

<resources tools:ignore="TypographyDashes,MissingTranslation" xmlns:tools="https://schemas.android.com/tools" > 

and

<resources tools:ignore="TypographyDashes MissingTranslation" xmlns:tools="https://schemas.android.com/tools" > 

I am now out of ideas. How can I specify several values in tools:ignore?

like image 696
rds Avatar asked Jan 22 '13 13:01

rds


People also ask

How do you ignore a lint warning?

To persistently configure which rules are run, you can create a file named lint. xml in the root directory of your project (next to the manifest file). Lint will automatically look at this file and use it to ignore warnings. Gradle, Android Studio and Eclipse will also use this configuration file if present.

What is suppress lint?

android.annotation.SuppressLint. Indicates that Lint should ignore the specified warnings for the annotated element.

What are lint warnings?

In many cases, lint warns you about incorrect, error-prone, or nonstandard code that the compiler does not necessarily flag. The lint program issues every error and warning message produced by the C compiler. It also issues warnings about potential bugs and portability problems.


1 Answers

You need to use a comma separated list, but there must not be blanks.

Example:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"     xmlns:tools="http://schemas.android.com/tools" // required to work     android:layout_width="match_parent"     android:layout_height="match_parent"     tools:ignore="contentDescription,SpUsage" > // comma separated list. NO blanks allowed! 

For a list of the valid options you can get a list from the command line or use the eclipse lint error checking list mentioned by throrin19:

lint --list > lint_options.txt 

See lint documentation.

like image 174
Gunnar Bernstein Avatar answered Sep 21 '22 14:09

Gunnar Bernstein