In an android library project I have many unused declarations, cause they mostly get called from outside of the project. I use lint via
Analyze -> Inspect Code
I dont want to use
@SurpressWarning("unused")
on each file.
If I try to disable it with the same ID in gradle file
android {
lintOptions {
disable 'unused'
}
}
The linter still comes up with the "Unused declaration" errors
I also tried it by creating lint.xml
file in project root
<?xml version="1.0" encoding="UTF-8"?>
<lint>
<!-- list of issues to configure -->
<issue id="unused" severity="ignore" />
</lint>
But it still doesn´t work. Anyone know the correct lint ID?
You can use Analyze -> Inspect Code
, then you right-click in one of the warnings. You will see there is an option called "Disable inspection":
Just click on it and you won't need to worry about unused declarations in your project anymore.
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