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
0
votes
3 answers

Android lint custom check UCallExpression type of method receiver

I'm writing custom lint check to ban some methods. So if someone calls banned method foo on instance of class A, lint should report error. I achieved this for static methods like this (inside visitCallExpression(UCallExpression): node.receiver as…
lsrom
  • 608
  • 8
  • 22
0
votes
1 answer

android lint false alarm on missing permissions

Android lint keep reporting Missing Permissions even though I added @RequiresPermission on my method. Code is: @NonNull @RequiresPermission(Manifest.permission.READ_CONTACTS) public static Map
0
votes
1 answer

How can I configure Android lint plugin to use previous unstable builds as references from Jenkins?

I'm currently using Android Lint Plugin in Jenkins to show the results of the lint checks. Instead of reporting the old warnings, I configured the plugin to report new warnings only via checking the option "Compute new warnings" and "Use previous…
adarliu
  • 483
  • 1
  • 3
  • 13
0
votes
1 answer

LinearLayout - Lint error when using style file (still working, though)

Problem: I get a lint error and warning on styles that are working, when defining the orientation of a LinearLayout in a styles file, but not when defining the orientation directly on the element. Even though the property is picked up from the…
0
votes
1 answer

How to execute a program which reads lint-results.xml of Jenkins once the build & lint check complete

I already managed to connect my git and automate Gradle build and execute android lint as the post-build action of the Jenkins. I can see the lint-results.xml file created in the following location. myapp/app/build/reports/lint-results.xml As the…
channae
  • 951
  • 1
  • 12
  • 28
0
votes
1 answer

Executing Android Lint on Windows by only using Android SDK tools (Without Android Studio or Android SDK)

I'm trying to execute Android Lint tests on windows without using Android Studio or Android SDK. I tried following approach as it is stated in the documentation that it's not required to have gradle or android studio. This requires to download…
channae
  • 951
  • 1
  • 12
  • 28
0
votes
2 answers

Android studio 2.3.3: lint options, factory reset

Not long time ago I checked all the lint options in Android Studio. I thought they were only meant for analyze->inspect code and while working with the project I worked on, it was ok. Now I started a new project and it's affecting it completely,…
Amos
  • 1,321
  • 2
  • 23
  • 44
0
votes
0 answers

False positive in Android lint check for LinkedHashMap.remove()

The issue in the lint result html Generated html section by lint for the issue
okmanideep
  • 960
  • 7
  • 23
0
votes
1 answer

Android Studio spelling checker with Gradle

Is there are any possibility to use the Android Studio "Spelling", "Typo" checker with Gradle? It's been a while, but I still cannot find any possible solution.
0
votes
1 answer

Expected resource of type anim when using ternary operator

This is a very silly compiler error, and I'm wondering if there's a simple way of suppressing it (such as with an annotation) ? The error occurs on the 2nd argument of setCustomAnimations(). The error is: Expected resource of type…
Kacy
  • 3,330
  • 4
  • 29
  • 57
0
votes
0 answers

Android Logger detector custom linter

I'm trying to write a custom linter that finds any usage of Log class in the project. Everything compiles and I do have other linters that work well so it seems that everything is integrated as it should be. Can you tell me what am I missing? public…
Rom Shiri
  • 1,390
  • 4
  • 16
  • 29
0
votes
1 answer

"This RelativeLayout layout or its RelativeLayout parent is possibly useless" - measure performance

Android Lint gives me these warnings "This RelativeLayout layout or its RelativeLayout parent is possibly useless; transfer the background attribute to the other view" or similar. I'm wondering simply: how can I measure the impact on performance…
MPelletier
  • 16,256
  • 15
  • 86
  • 137
0
votes
0 answers

Google Volley Singleton pattern Request Queue Lints

I have been trying to implement Volley in my project. I am using google developers guide for understanding the concepts. In the second lesson, setting up RequestQueue as a singleton(Recommended practice) is taught. The following is a code snippet…
mrtpk
  • 1,398
  • 4
  • 18
  • 38
0
votes
1 answer

eclipse cause Lint error when save any layout xml files

I think I'd tried everything to fix it but failed. I've downloaded eclipse from here: http://www.eclipse.org/downloads/packages/eclipse-android-developers-includes-incubating-components/neonr It's the latest eclipse package made to work with android…
shawhu
  • 1,217
  • 1
  • 12
  • 27
0
votes
1 answer

Android enable warning for custom library if new version is available

With the support libraries, for example, Android Lint will show a warning if the library is not using the latest version. However, when I created my own library and published it through Bintray, no warning is displayed when using an older version.…
Sean
  • 445
  • 1
  • 5
  • 10