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

Android Lint - NewApi check still fails despite suppression with @TargetApi

Following an unsuccessful Lint run, I attempted to fix an error by adding the @TargetApi(Build.VERSION_CODES.HONEYCOMB) attribute, but the next time Lint is run, the following error still shows for the getScaleX() function: Can anyone shed some…
Hong
  • 17,643
  • 21
  • 81
  • 142
1
vote
3 answers

Why doesn't eclipse complain about this deprecated method?

In my manifest.xml I have defined: and in android's documentation for View class it's been said: setBackground(Drawable) // ADDED IN API LEVEL 16 This method has…
Joseph_Marzbani
  • 1,796
  • 4
  • 22
  • 36
1
vote
2 answers

Android Studio unable to resolve ?android: resources

Android Studio is complaining about being unable to resolve ?android resources in xml layouts. It is building and running these projects without complain, but whenever I look at my layout or do a commit it is highlighting them as errors. Any…
Ankhwatcher
  • 420
  • 6
  • 19
1
vote
3 answers

How to use tools:locale for strings.xml files?

Background Lint has a relatively new feature, so that it will warn us about missing translation only for languages that we choose, but i don't get how to use it. The problem for some reason, Lint still warns me about languages that i don't intend on…
android developer
  • 114,585
  • 152
  • 739
  • 1,270
1
vote
1 answer

Gradle lint can't find classes referenced in AndroidManifest.xml

When I run gradle lint From project dir or root dir I get whole bunch of reports (for every Activity and Application) like
Yaroslav Mytkalyk
  • 16,950
  • 10
  • 72
  • 99
1
vote
1 answer

Android Max View Count?

I'm writing an app with 100+ (116 to be precise) Image Buttons. When I'm trying to run the app, it automatically closes and tells me the following: The maximum view count defaults to 80 but can be configured with the environment variable…
user2898518
  • 21
  • 1
  • 5
1
vote
1 answer

Nested Weights Vs Nested Layouts with weights. Which is better?

Android Lint gives us warning when we do nested weights saying that nested weights are bad for performance so i was wondering what will happen if i add an extra layout which encloses the nested weigh layouts. Will it make any difference in…
1
vote
2 answers

ADT doesn't warn me about calling functions from the wrong API level

I have an Android project with minSDK 8 and targetSDK 17. I used a call to a function introduced in API Level 9 (Camera.getNumberOfCameras()). ADT doesn't seem to mind this and compiles just fine with no warnings. I set the targetSDK to 8 as well,…
Fergusmac
  • 3,679
  • 4
  • 20
  • 24
1
vote
1 answer

Android Lint misidentifying unused resources

Android Lint thinks I have some unused resources, like data0454.xml whereas actually the file is being used in a loop, like this: "data" + numberString + ".xml" What should I do about this - change my program design, or try to hide the Android…
1
vote
1 answer

Does NewApi check in Android Lint is based on classes SDK level only?

I'm quite new with Android development, and I wanted to learn a bit about Lint tool and NewApi check. After doing some tests I'm a bit confused though. After creating new Android application project in IntelliJ IDEA, I added some code to the…
Arek Dygas
  • 103
  • 9
1
vote
4 answers

Why does Android Lint say "Call requires API level 8 (Current min is 8)"?

I could understand if the API level required by the call was higher than the minimum, but why should it be a problem if it's equal to the minimum?
joe_deniable
  • 2,562
  • 3
  • 28
  • 38
1
vote
4 answers

supressLint cannot be resolved to a type error (android beginner tutorial online)

In thefollowing Code, I get a problem when following the Android beginners tutorial at http://developer.android.com/training/basics/firstapp/starting-activity.html#StartActivity Eclipse is saying: supressLint cannot be resolved to a type error with…
user2395110
  • 11
  • 1
  • 3
1
vote
1 answer

How can I manage Lint ignore/exclusion list in Eclipse?

In Eclipse for an Android project I had some warnings in xml files and added some of them in Lint ignore/exclusion list via the quick fix window using "Disable Check In This File Only". Now I would like to remove a file from the list to be checked…
L. G.
  • 9,642
  • 7
  • 56
  • 78
1
vote
2 answers

Hide warnings in layout files

I updated Eclipse and SDK and now in every xml file the TextViews have the warning "Consider making the text value selectable by specifying android:textIsSelectable="true"". Is it possible to hide the warnings, I hate to have my project with a lot…
crbin1
  • 2,219
  • 3
  • 22
  • 29
1
vote
3 answers

Eclipse error mark doesn't disappear after fix

I'm developing an Android application on Eclipse Juno, and using a MAC OS Lion. When I fix some error in a xml file the error mark doesn't disappear, and it doesn't let me compile the code even if I fix it. I tried deleting it through Window-> Show…
Anika
  • 398
  • 5
  • 23