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
1
vote
2 answers

Strange Lint-errors in Android project

since I updated my Android SDK today I get some strange Lint errors in my project. The activity contains amongst others a textview. Everything works fine, but if I want to change the text size of the view within the code with .setTextSize(float…
Tobi N
  • 554
  • 6
  • 22
1
vote
1 answer

Confused about "UselessParent" Lint check

I have some layout file which Lint is giving me the following warning about: UselessParent Summary: Checks whether a parent layout can be removed. Priority: 2 / 10 Severity: Warning Category: Performance A layout with children that has no siblings,…
rfgamaral
  • 16,546
  • 57
  • 163
  • 275
1
vote
2 answers

Android: is correcting Lint warnings useful or not?

I have built and published my app on Google Play and everything works fine. But I am wondering how I can improve my visibility on the market, how to appear on the first page... So here is my question, Do I have to correct every little bug that…
litil
  • 413
  • 1
  • 6
  • 19
1
vote
2 answers

Does Android Lint cache old results someplace, and if so, how do I clear it?

I've been cleaning up Lint warnings on my Android project, but some of them seem to persist even after I've fixed them. For example, I got this warning: Use android.util.FloatMath#sqrt() instead of java.lang.Math#sqrt to avoid argument float to…
Argyle
  • 3,324
  • 25
  • 44
1
vote
3 answers

Why is Android lint showing "nested weights are bad for performance" when none are nested?

The layout_weight attribute in the last TextView in this layout is being highlighted by lint as causing bad performance. I suspect the name of the lint warning is erroneous as there are no nested weights. There are several stretching views, and I…
Ollie C
  • 28,313
  • 34
  • 134
  • 217
0
votes
1 answer

Android lint - simply returns "does not exist"

I have Android tools r16 installed on a Win7 machine. I have the tools folder in my path. I can run "lint" and the command executes, giving me help on the command line parameters. I then navigate to a project folder, and type: > lint . I expected…
Ollie C
  • 28,313
  • 34
  • 134
  • 217
0
votes
0 answers

Custom lint rule to check 'override' functions in Kotlin

I want to write a custom lint rule to detect 'override' functions in Kotlin. override fun testFunction(test: String) { // function body } I would like to detect whether any function I am traversing via UAST is an override function. override fun…
pseudobot
  • 13
  • 3
0
votes
1 answer

Explanation on lint warnings for some of my properties

Analyzing code I found these warnings. Could someone explain me some details about them please. Any alternatives will be welcome interface A { var someBoolean: Boolean // Boolean method 'someBoolean' is always inverted } class B { var…
Edhar Khimich
  • 1,468
  • 1
  • 17
  • 20
0
votes
1 answer

lintOptions deprecated , What is the alternative?

I have upgraded Android Gradle Plugin to 7.4. Now getting warning lintOptions are deprecated. What alternative is to be used for this?
Rumit Patel
  • 8,830
  • 18
  • 51
  • 70
0
votes
0 answers

Getting lint error while accessing Java variable from Kotlin Test Class

I have been trying to write test case for my Activity. But, android lint showing warnings while accessing public variable/method in Activity from Kotlin Test Class. Here is the lint warning: Cannot access…
Suneesh Ambatt
  • 1,347
  • 1
  • 11
  • 41
0
votes
1 answer

Custom lint rule added for a XML Layout tag, doesn't report the issue in layout file

So, I have created a custom lint rule for FlowLayout tag (a 3rd party library) to replace it with ConstraintLayout's Flow feature, here is the code: class FlowLayoutDetector : LayoutDetector() { override fun appliesTo(folderType:…
Suraj Vaishnav
  • 7,777
  • 4
  • 43
  • 46
0
votes
0 answers

Do not treat position as fixed; only use immediately and call holder.getadapterposition() Solution Error

enter code hereHello, my app is running but the adapter has an lint error. My app has a recyclerview in grid layout and have a delete function for each data. my code in adapter is package com.example.mygram; import android.content.Context; import…
0
votes
0 answers

Turn android lintVitalAnazlyzeRelease of for jar projects we bring in from gradle?

We ran into some bug in linVitalAnaylzeRelease * What went wrong: Execution failed for task ':app:lintVitalAnalyzeRelease'. > java.lang.NullPointerException (no error message) We narrowed it down to the fact we are using gradle composite builds…
Dean Hiller
  • 19,235
  • 25
  • 129
  • 212
0
votes
0 answers

Detect if a method is called with Android Lint

I'm playing around with Android Lint and I'm trying to detect if in a gradle file a method is called, my build.gradle is like this : plugins { ... } android { ... } dependencies { ... } myMethod() This myMethod() is a common configuration and I…
StuartDTO
  • 783
  • 7
  • 26
  • 72
0
votes
0 answers

Unable to load class 'com.android.tools.lint.model.LintModelModuleLoaderProvider'

I am working on a project where I help a client to add some features to an app that has been created previously about a year back. I made the changes and have been running into problems while trying to build the project and generate bundle, I have…
Bishop
  • 13
  • 3