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

Android Lint says I can replace a layout with a tag, but I need the id of the layout in a fragment transaction

I have a tabbed interface in Android and use a FrameLayout as my main layout in my app. I'm getting an Android Lint warning that says: This can be replaced with a tag The only place I use this FrameLayout (named…
7
votes
2 answers

Force lint to check translations on exact languages

I get this error: "preferences_default_reminder_labels" is not translated in cs, de, es, fr, it, ja, ko, nl, pl, pt, pt-rBR, zh Issue: Checks for incomplete translations where not all strings are translated Id: MissingTranslation But my app…
karabara
  • 547
  • 6
  • 24
7
votes
1 answer

How do I suppress the warnings about me using px in a layout xml?

I am working with a project that includes a Sony SmartWatch and when I send layouts to that I need to use real pixel values. [If you haven't used on its a watch that is connected via bluetooth and works as an extra display the "controlling" device…
Jontas
  • 409
  • 3
  • 12
7
votes
1 answer

why I cannot use "run Android lint" from menu "Window" in Eclipse in toolbar I can run it, is it OK?

I have just updated SDK and ADT for eclipse and now there is one thing confused me: I cannot use "Run Android Lint" from menu "Window". But I can run it from eclipse toolbar or richt-click on my project, then "Android tools" -- "run lint". I'm not…
Katrina
  • 83
  • 7
6
votes
1 answer

Custom lint check: identify generic on expression call

I'm trying to write a lint check, that visits call expressions, and report on some violation based on a generic type. To make it more clear, let's say I have this code: object Foo { inline fun bar() = T::class.java } And let's say…
Redwarp
  • 3,221
  • 3
  • 31
  • 44
6
votes
0 answers

Android Lint on Windows does not respect file *nix style paths with slash in lint-baseline.xml

I have a drawable file with the IconDipSize Lint issue. This issue is suppressed in lint-baseline.xml file generated on macOS machine, so that it contains file paths with slash, instead of Windows-style backslash.
6
votes
2 answers

Android Lint reports OldTargetApi when targetSdkVersion is 29

I'm getting the following Lint error on Github Actions (current CI solution for the project) > Task :application:lint FAILED Ran lint on variant debug: 1 issues found Ran lint on variant release: 1 issues found Wrote HTML report to…
Robert Estivill
  • 12,369
  • 8
  • 43
  • 64
6
votes
6 answers

How to solve NonNull annotation after Android Studio 3.2?

After updating to Android Studio 3.2, I've been getting a "Probable bugs" from lint saying: "Not annotated method overrides method annotated with @NonNull". I had no issue before updating to Android Studio 3.2, how do I solve…
6
votes
0 answers

Sonar dont check Android Lint errors in XML

I have an Android project checked in Sonarqube. It seems to be set up correctly with Java, Android and XML plugins I have also both Java and XML parsed: My Gradle fragment for Sonar plugin looks like: sonarqube { properties { property…
Dzinek
  • 786
  • 7
  • 17
6
votes
1 answer

Why a lint warning about fullBackupContent warning when allowBackup is false?

For an app with android:allowBackup="false", Android lint reports: Should explicitly set 'android:fullBackupContent' to avoid backing up the GCM device specific regId. Is this just a bug in the lint rule, or do I really need to be concerned about…
6
votes
0 answers

Android Build Tools 1.1.0 - Lint fails on Unknown issue id "ImproperProjectLevelStatement"

I upgraded an app from android gradle build tools 1.0.0 to 1.1.0. Lint fails now with: LintError: Lint Failure Unknown issue id "ImproperProjectLevelStatement"
Hari
  • 401
  • 4
  • 10
6
votes
0 answers

Android SDK Lint tool Ignoring NewAPI warnings

I am running the Lint tool from Eclipse(Android SDK). My settings are default and NewApi is set up as Error in my Android Lint Settings However, when I run Lint (by Package Explorer > Android Tools > Run Lint: Check for Common Errors.), It seems to…
A Nice Guy
  • 2,676
  • 4
  • 30
  • 54
6
votes
2 answers

Using Android's XML element on rootview for activity's layout

I am using the following layout: --------------------- FrameLayout .>>. FrameLayout .>>. FrameLayout --------------------- This layout is set on some Activity using setContentView(). I just run lint to analyse my project and got the…
woot
  • 3,671
  • 4
  • 26
  • 39
5
votes
3 answers

Display Android Lint results in Jenkins

How can I display the results from Android Lint in Jenkins, e.g. as warnings? I want to browse the warnings from the Jenkins GUI, just like compiler warnings and PMD / Checkstyle warnings. The output from the Jenkins job is something like this: …
stefan222
  • 669
  • 1
  • 11
  • 30
5
votes
1 answer

Android Lint : Kotlin Dispatchers unresolved reference but compilation working

I have already tried invalidating caches. Clean build and rebuild project also done. But I still keep getting unresolved reference for : Dispatchers, launch, withContext, delay, ... But CoroutineScope isn't marked as unresolved reference, the import…