Questions tagged [android-lint]

Android Lint is a tool in ADT which scans Android project sources for potential bugs.

Android Lint is a tool in which scans project sources for potential bugs. It is available both as a command line tool, as well as integrated with .

Here are some examples of the types of errors that it looks for:

  • Missing translations (and unused translations)
  • Layout performance problems (all the issues the old layoutopt tool used to find, and more)
  • Unused resources
  • Inconsistent array sizes (when arrays are defined in multiple configurations)
  • Accessibility and internationalization problems (hardcoded strings, missing contentDescription, etc)
  • Icon problems (like missing densities, duplicate icons, wrong sizes, etc)
  • Usability problems (like not specifying an input type on a text field)
  • Manifest errors

and many more.

336 questions
43
votes
2 answers

Retrolambda: Lint crashes when using lambda expressions with retrolambda

I'm trying to use retrolambda along with gradle-retrolambda plugin. In general it works fine, but when I compile for release, the lint stage fails with exception: :playground.dagger:lintVitalReleaseFailed converting ECJ parse tree to Lombok for file…
42
votes
3 answers

Understanding @SuppressLint("NewApi") annotation

I am an android beginner. While trying a code of managing activity life cycle, I encountered a new thing. package com.example.activitylaunch; import android.os.Build; import android.os.Bundle; import android.annotation.SuppressLint; import…
vhd
  • 2,008
  • 6
  • 20
  • 21
37
votes
4 answers

Using FloatMath or Math and a cast?

In the latest update of the Android API the FloatMath is marked with the following lint-warning: In older versions of Android, using android.util.FloatMath was recommended for performance reasons when operating on floats. However, on modern…
Jave
  • 31,598
  • 14
  • 77
  • 90
35
votes
8 answers

Meaning of "No label views point to this text field" warning message

What is the meaning of this warning? No label views point to this text field with an android:labelFor="@ id/@ id/editText1" attribute Note that the double id (@id/@id) is a problem with the error message text and does not reflect the XML…
user2447702
  • 359
  • 1
  • 3
  • 3
33
votes
3 answers

Disable `lint` in Android gradle

From the Android Tools Project Site's Android Gradle Plugin User Guide I'm aware that it's possible to prevent Android's lint from aborting a build using: lintOptions { abortOnError false } I'm also aware that lint can be disabled for release…
Armand
  • 23,463
  • 20
  • 90
  • 119
33
votes
5 answers

Call requires API level 16 (current min is 14): android.app.Notification.Builder#build

The documentation says Notification.Builder is Added in API level 11. Why I get this lint error? Call requires API level 16 (current min is 14): android.app.Notification.Builder#build notification = new Notification.Builder(ctx) …
pt2121
  • 11,720
  • 8
  • 52
  • 69
30
votes
5 answers

Android Lint erroneously thinks min SDK version is 1

Eclipse refuses to build my Android project. In the package explorer, the project root node has the little red error symbol, but nothing else inside of it has this symbol. The Problems tab shows errors detected by Lint: Call requires API level 3…
jdk
  • 303
  • 1
  • 3
  • 6
29
votes
2 answers

Expected resource of type animator [ResourceType]

I've updated my SDK to the newest version, but now I am getting a lint error. Error: Expected resource of type animator [ResourceType] The error occurs on this line: AnimatorInflater.loadAnimator(context, R.anim.right_slide_in) The referenced…
Marcin Kunert
  • 5,596
  • 5
  • 26
  • 52
29
votes
8 answers

Constant 'Running Android Lint' Failed, nullpointerexception popping up in Eclipse (but doesn't seem to be my code)

I don't recall what it is I updated (probably some android ADK items), but suddenly I keep getting a "Problem Occurred" text box in Eclipse, frequently. It says: 'Running Android Lint' has encountered a problem. Failed And there is an OK and a…
Rob
  • 801
  • 2
  • 9
  • 16
26
votes
1 answer

Why is ContextThemeWrapper now restricted to the Support Library group?

I started using a ContextThemeWrapper to apply a style dynamically to an ImageButton; based an answer to another question of mine, and answers to other similar questions. ContextThemeWrapper wrapper = new ContextThemeWrapper(getContext(),…
25
votes
4 answers

Android Lint report for my project only, excluding library projects?

How do I run Android Lint so it only reports on my project module, and ignores any library projects I'm using? Even when I aim Lint at my project's module, it spews out lists of issues in the library projects which I'm not interested in - I want to…
Ollie C
  • 28,313
  • 34
  • 134
  • 217
25
votes
5 answers

Android Lint - How to hide a warning 'The resource Xxx appears to be unused'

I'd like to disable the (new) Android Lint warning 'The resource Xxx appears to be unused' for some specific resources. For other Lint warning I was ableto take advantage of Quick Assist, which showed 3 choices to disable the warning, one of those…
superjos
  • 12,189
  • 6
  • 89
  • 134
24
votes
3 answers

Android Lint limit languages to check for missing translations

My app supports only 2 languages - English and German. So I have such folders structure for languages strings: myproject/res/values/strings.xml myproject/res/values-de/strings.xml When I run Lint check I get many warnings about missing languages,…
Paul Annekov
  • 3,193
  • 3
  • 19
  • 31
22
votes
4 answers

Warning: This can be replaced with a tag

I have a FrameLayout that contains a TextView and two LinearLayouts: ... a textview and…
Oleksiy
  • 37,477
  • 22
  • 74
  • 122
20
votes
7 answers

How to solve this : 'Running android lint' issue

In any activity of my project, if i do some changes and then save that activity i got the message "Running android lint has encountered a problem." This is the my error log : java.lang.NullPointerException at…
AndroidLearner
  • 4,500
  • 4
  • 31
  • 62
1
2
3
22 23