I run ./gradlew clean lint
command in console and get Lint report in build/lint/ReleaseOutput.html and build/lint/ReleaseOutput.xml I got 6 times the same error: And I also see 6 times the same times one issue in XML file:
<issue id="UselessParent" severity="Error" ... </issue>
So, why it has happened and how to avoid such problem? Because one issue multiply 6 and displayed incorectly in Jenkins statistics.
UPDATE:
I found that this bug related to gradle lint task. To get lint metrix Gradle build few times:
file="build/manifests/release/AndroidManifest.xml" file="build/manifests/debug/AndroidManifest.xml"
So it also can double total number of issues.
The lint tool checks your Android project source files for potential bugs and optimization improvements for correctness, security, performance, usability, accessibility, and internationalization. When using Android Studio, configured lint and IDE inspections run whenever you build your app.
Tip: If you are using Android Studio, you can use the File > Settings > Project Settings > Inspections feature to manage the lint checking to your Java or XML source files.
In many cases, lint warns you about incorrect, error-prone, or nonstandard code that the compiler does not necessarily flag. The lint program issues every error and warning message produced by the C compiler. It also issues warnings about potential bugs and portability problems.
To utilize Lint or just run inspections in your project, add Lint inspection to the lint. xml file or manually pick the list of issues to be configured by Lint in your project using Android Studio. Configure the lint file: Add the list of issues to be configured in the lint.
Also you can run ./gradlew clean lintDebug
so lint only analyze the debug
build, in that way you increase the speed and you get only the warning for that build. Also you have to had in mind that if you use flavors the warnings could be reported by build type
and also by flavor
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With