I've noticed that Android Studio will verify that @Nullable
isn't being ignored in the code:
ex.
@Nullable MyObject getMyObject();
...
MyObject o = getMyObject();
o.method();
^
Method invocation 'method' may produce 'java.lang.NullPointerException'
This is enforced by the NullableProblems
IntelliJ warning.
I would like to enforce this rule from gradle at build-time via lint rule. Does anyone happen to know if it's possible to enable something similar to that via gradle?
If you want lint to throw an error when certain rules are broken in the source code, you can definitely configure the project in a way that the source compilation halts. I could have written the whole process but this link more or less summarizes the whole thing
Also go through the Android link doc
Note : Analyze
option in Android Studio Menu mostly uses both Lint and built in Intellij Idea Code inspection
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