336 questions
0
votes
1
answer
49
views
Azure Devops - Could not determine the dependencies of task ':Myapp:lint'
I would like to run Azure pipeline for Android project and ending up with error while building.
I also have tried to include in build.grade but no luck.
android {
....
....
lintOptions {
...
0
votes
1
answer
567
views
How to Use Custom Lint in Android Studio
I have some custom lint for my android project. Initially I wrote this code in new project and it was working there, I can see my new lint in Android Studio Ispection tab in Setting. But When I pasted ...
0
votes
1
answer
455
views
Custom lint rule: How to fix "This annotation is not applicable to target 'expression'"
I am writing my first custom lint-detector for android/compose:
"Don't use the standard button, use our specifically styled custom button"
The detector itself is working as expected:
Lint ...
2
votes
1
answer
85
views
Custom Lint - Checking for gradient tag in vector fails
I'm writing a custom lint rule to catch if android:src namespace is being used for displaying vector drawables which have gradient tag in them instead of app:scrCompat namespace.
Android Studio is ...
0
votes
1
answer
92
views
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 '...
0
votes
1
answer
77
views
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() {
...
1
vote
0
answers
120
views
Android Studio inspection profile doesn't contain all the rules
It seems to me that Android Studio inspection profile doesn't allow me to choose the same inspection that is used by Gradle command ./gradlew lint.
I'm interested in running "LiveData value ...
2
votes
0
answers
155
views
Lint check to detect Implicit Internal Intent vulnerability
We got an error in Play Store Console about our app having an "Implicit Internal Intent" vulnerability (error info). The error is fixed, however we would like to add a way to detect these ...
0
votes
1
answer
63
views
AndroidLint default rules location
I'm trying to learn more about android lints. So I want to see already implemented rules. I searched a lot but I couldn't find the location of these files.
Can someone give me the location or link to ...
7
votes
0
answers
969
views
Applying options for using lint from command line in Android
Hi Stackoverflow Community,
I would like to apply a lint check for my Android project from command line WITH options/parameters.
First I tried the standalone lint tool which comes with the Android SDK ...
2
votes
1
answer
534
views
How to disable IssueRegistry#vendor for specific library and pass ci check in Android?
I have this error when do ciCheckDebug:
jetified-butterknife-runtime-10.2.3\jars\lint.jar does not specify a vendor; see IssueRegistry#vendor
Cannot find, how to disable it without abortOnError=false ...
12
votes
2
answers
15k
views
Unboxing may produce Null Pointer Exception after checking if key exists in Map
Android Studio gives the warning: Unboxing of 'idCollisonMap.get(currentId)' may produce 'NullPointerException' even though I am checking if the key exists before I perform the Map.get().
Am I ...
1
vote
0
answers
261
views
How can we get the root project path in android lint check code?
I have a multi projects structure. One is the lint project including lint logic code. I wanna get the root project dir. I test some ways.
println("mainProject.dir ${context.mainProject.dir}")...
0
votes
0
answers
92
views
In android, Can we use conditions to make sure that developer always writes unit test?
In android, how can I make sure that developers always write unit test of each method they wrote? Is there a lint or klint library or custom code to check that, for example If i have written a ...
11
votes
1
answer
6k
views
Lint is giving error if I use java.lang.Iterable#forEach in android code
In my android code (Kotlin) I am using forEach method of java iterable.
mandatoryViews.forEach { view ->
// my code here
}
Below is my sdk config in build.gradle (app):
minSdkVersion 23
...
4
votes
0
answers
276
views
Why running Android Lint on pipeline is giving different warnings?
I've enabled the Android Lint on my app module with config xml with these enabled rules, and also created a baseline.
lintOptions {
checkReleaseBuilds false
abortOnError true
...
0
votes
0
answers
353
views
How can I get the name of the function within which something is being called in an Android lint check?
I'm writing a lint check to flag code that is calling a specific function from within a click listener on an Android view.
For example:
// case 1
button.setOnClickListener(object: View.OnClickListener ...
1
vote
2
answers
890
views
How to get rid of deprecation warnings when providing backwards compatibility?
How one can get rid of linter deprecation warnings? For example, the annoying NetworkInfo:
warning: [deprecation] NetworkInfo in android.net has been deprecated
7
votes
2
answers
5k
views
“Obsolete custom lint check” from `androidx.appcompat.AppCompatIssueRegistry` which requires a newer API level
I’ve got a project in which I get the following Android lint warning:
Obsolete custom lint check
../../../../../../../.gradle/caches/transforms-2/files-2.1/fc4398fa701898f50fcec85691d33578/appcompat-...
0
votes
1
answer
1k
views
How to share Android lintOptions across modules
I am building a multi-module app and in each module I have lint settings as follows
android {
...
lintOptions {
quiet true
abortOnError false
warningsAsErrors true
}
...
4
votes
1
answer
2k
views
Custom android lint rules not being executed
I have created two custom lint rules and verified that they work as expected with unit tests. However, when I try to run lint on the whole project with ./gradlew app:lint these rules are not executed.
...
0
votes
1
answer
155
views
Have different Android lintOptions for different gradle tasks
I want to run the Android Lint both locally (IDE) and on the CI.
I have a task like this, which I want the abortOnError as true when run on CI but false when ran locally.
task lintCI {
outputs....
5
votes
1
answer
2k
views
How to detect deprecated androidx.legacy.widget.Space class?
Context
I am using the androidx.legacy.widget.Space in a layout in an Android application project:
<androidx.legacy.widget.Space
android:layout_width="match_parent"
android:...
6
votes
0
answers
143
views
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-...
0
votes
1
answer
696
views
How to check if kotlin attribute is private in android lint?
I am writing a custom android lint to help to check if the private attributes match naming convention.
I used the test cases to verify my implementation. I used a method called ...