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
4
votes
1 answer

android lint - InvalidPackage errors when using apache odata-client-android

I want to use the apache olingo odata library in an android project. Since apache offers a specific build for android, i put this one as a dependency to my build.gradle file. compile 'org.apache.olingo:odata-client-android:4.0.0' When building the…
sebhaub
  • 714
  • 6
  • 16
4
votes
0 answers

Why is the GIF file format discouraged in Android?

One of the Lint warnings under the "Usability:Icons" header in a recent Lint report included the following message: GifUsage: Using .gif format for bitmaps is discouraged (code references omitted) The .gif file format is discouraged. Consider using…
CJBS
  • 15,147
  • 6
  • 86
  • 135
4
votes
0 answers

Lint mark all resources which used thru R-file as unused

I have a gradle-based android app. The project structure looks like: project libs ActionBarSherlock src AndroidManifest.xml DragSortListView src AndroidManifest.xml PhotoView-1.2.2 src …
Dmitriy Tarasov
  • 1,949
  • 20
  • 37
4
votes
1 answer

Consider TextView to be selectable

I have the following warning (from the Lint) on each TextView with an ID in my XMLs. Consider making the text value selectable by specifying android:textIsSelectable="true" Can anyone please explain me why does it suddenly (from ADT 21.1)…
Yaniv
  • 3,321
  • 8
  • 30
  • 45
3
votes
6 answers

Best practice for language-independent strings

My Android application contains a number of language-independent strings, such as tariffs and support phone numbers. I've placed a XML file in /res/values containing for instance: 0900 12345678
Paul Lammertsma
  • 37,593
  • 16
  • 136
  • 187
3
votes
1 answer

Warnings in xml resources

Yesterday I installed ADT plug-in again as I was having problems (intermittent) with the version I already had. The thing is, I'm not getting warnings in all my xml resources. I am pretty darned sure I haven't seem them before. Some of these are…
Code Poet
  • 11,227
  • 19
  • 64
  • 97
3
votes
0 answers

Why does Android Studio not generate the reports folder under build?

I was looking at an SO answer for the error I am getting - "Lint found fatal errors while assembling a release target.". It suggests looking at the reports folder but the build folder does not have it: Do I need to configure Android Studio in a…
Hong
  • 17,643
  • 21
  • 81
  • 142
3
votes
0 answers

Applying options for using lint from command line in Android

Hi Stackoverflow Community, I would like to apply a lint check for my Android project from command line WITH options/parameters. First I tried the standalone lint tool which comes with the Android SDK Tools…
Mario646
  • 43
  • 5
3
votes
1 answer

lint.xml file can not be found when i move it from module directory to project directory

I have an lint.xml file and want to apply it to whole project but not only one module. It can't be found when i move it from module dir to project dir. This is my config about lintOptions in build.gradle from module lintOptions { …
Cyrus
  • 8,995
  • 9
  • 31
  • 58
3
votes
0 answers

Lint task never finishes for Android multi-module project with dynamic feature module

Our app contains over 20 multi-modules and one on-demand dynamic feature module. Before adding dynamic feature module, it took 20-30 mins for lint task to complete both on CI and local, but after adding dynamic feature module, it DOES NOT COMPLETE…
3
votes
2 answers

SourceCodeScanner not calling visitMethodCall

I'm playing with lint rules. All my ResourceXmlDetector run without problems and pass all the tests. But Detector(), SourceCodeScanner are failing because they return 0 warnings/errors, and the reason is visitMethodCall not being called thus…
GuilhE
  • 11,591
  • 16
  • 75
  • 116
3
votes
2 answers

Custom Lint annotation detector is not triggered

I am trying to write my first Lint rule. For now I just want to detect the use of the annotation @AnyThread. I have created a module to implement my custom rule. The gradle file for this module is (I use the gradle plugin version…
eqtèöck
  • 971
  • 1
  • 13
  • 27
3
votes
0 answers

RequiresApi does not warn

I have put @RequiresApi annotation on the method in an android library project. When I use the library in my app, android lint does not complain of the RequiresApi requirement. This is the library i am trying…
yausername
  • 750
  • 5
  • 15
3
votes
0 answers

Integrate Android Studio's "Inspect Code" into CI?

I understand that lint is one of approaches of Android Studio's Inspect Code and executable by gradle task, so I could integrate it into CI effortlessly. Although Inspect Code could be triggered through terminal according to the IntelliJ doc , the…
3
votes
1 answer

android lintoptions with baseline file is not working

I have a project which has few lint warnings. For newly created changes if there are any lint warnings I want the build to fail. To do that I have added following options in gradle file. lintOptions { baseline file("lint-baseline.xml") …
AndroidDev
  • 1,485
  • 2
  • 18
  • 33