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

Unable to perform lint check after update of dependencies

After the last update of build tools and support libraries: Gradle Android plugin (2.2.3 -> 2.3.0-beta2), Gradle from (3.1 -> 3.3), Android Support library (25.0.1 -> 25.1.0) Android Build Tools (25.0.1 -> 25.0.2) I unable to perform lint…
Raman Budny
  • 165
  • 1
  • 7
1
vote
1 answer

Lint crashes with an exception during analysis with classes that contain retrolambda

I'm using retrolambda with android-retrolambda-lombok but lint crashes anyway during :app:lintVital** task. These two are in my projects build.gradle and I excluded com.android.tools.external.lombok as in readme. classpath…
Alexander Perfilyev
  • 6,739
  • 2
  • 17
  • 30
1
vote
2 answers

Android lint: How to disable "NewerVersionAvailable" check for testCompile dependencies?

I'm using NewerVersionAvailable lint check to determine newer dependencies versions. But it looks like that this check is useful only for implementation dependencies. I think we don't need to update junit anytime soon. How to disable this check for…
Pazonec
  • 1,549
  • 1
  • 11
  • 35
1
vote
0 answers

Android Studio: Lint checks for Jack compiler

Android Studio reports this Lint error when I use try-with-resources: Try-with-resources requires API level 19 (current min is 17) This reports is wrong: since I use the Jack compiler, I can use this feature also for older API versions (at least it…
TmTron
  • 17,012
  • 10
  • 94
  • 142
1
vote
1 answer

AndroidAnnotations: how to handle "activity is not registered in the manifest"

When I use @EActvity in IntelliJ IDEA (v2016.2.4), the Code Inspection will issue a warning: e.g. The ' my.package.TestActivity' is not registered in the manifest what is the recommended way of handling this situation? the Lint help in…
TmTron
  • 17,012
  • 10
  • 94
  • 142
1
vote
0 answers

Android lint not happy with resources in flavors

I'm getting a lot of lint errors in Android Resources Validation. It looks like all of them are inside resources that are in my flavors rather than the main app. An example would be:
vkislicins
  • 3,331
  • 3
  • 32
  • 62
1
vote
1 answer

Publish Android Lint results from Pipeline project

I am building an Android project with Jenkins (2.0 Beta) as a Pipeline. From a Freestyle job I can archive the build results using a post build action Publish Android Lint Results. My Pipeline script is: node { stage 'Checkout' git branch:…
1
vote
6 answers

How to add a default contructor

Hope I am not duplicating a question here, but all of the ones I found on stack exchange dont seem to fit my need. Here is a snippet of my code: public class custom_row_adapter extends ArrayAdapter { custom_row_adapter(Context context,…
1
vote
1 answer

Install tracking needs to been exported or not?

I am tracking my installs with two methods like you can see here in my manifest:
rekire
  • 47,260
  • 30
  • 167
  • 264
1
vote
1 answer

Additional lint rules in Android

I want to include some additional lint rules in my Android project. And by additional rules, i mean that i just want to include some extra rules from the list given in Android Studio( Pic attached) From the picture, i want to include the non-checked…
Diffy
  • 2,339
  • 3
  • 25
  • 47
1
vote
1 answer

Exclude files from code inspection tool in Android Studio

Android code inspection for html files gives an error "Start tag has wrong closing tag" and "Closing tag matches nothing " but everything is fine in that particular html file. I looked around in Android Studio and inspection settings as such but not…
praveen_85
  • 182
  • 2
  • 13
1
vote
1 answer

Where is the lint output file located in an android project?

Hi I'm setting up an android project to run with jenkins on an worker(remote server), I'm trying to run build manually with: ./gradlew assemble --stacktrace I get an error Caused by: org.gradle.api.GradleException: Unable to create lint output…
user1796624
  • 3,665
  • 7
  • 38
  • 65
1
vote
1 answer

How to add custom system service name to @ServiceName StringDef?

In some of our Activities, we've overridden getSystemService() method to return some custom objects for custom service names. It works well for us, to pass down some object to a View somewhere deep inside such Activity. But in Android Studio we get…
Marcin Koziński
  • 10,835
  • 3
  • 47
  • 61
1
vote
3 answers

Is it possible to mock locations for release build type

I'd like to mock locations in release build type of Android app. I've created a special flavour "mockable" manifest in app/src/mockable/AndroidManifest.xml
Marian Paździoch
  • 8,813
  • 10
  • 58
  • 103
1
vote
1 answer

How do i get Android Studio's Lint to alert me about calls that don't meet minSDK?

I have set the min sdk version in build.gradle as minSdkVersion 8 (I set it low so it was easy to find an API that wasn't added yet). but when I run Analyze->Inspect Code... it doesn't show the call to the above-8 API in the errors. How do I get…
Don Rhummy
  • 24,730
  • 42
  • 175
  • 330