1

I detect in my project a linter error.

Call requires API level 26 (current min is 23): java.time.format.DateTimeFormatter#format
@Add RequiresApi(O) Annotation

I'm wondering why my project is compiling. Because the app crashs on devices which have a smaller API level than 26.

Fixing the problem wasn't hard, but of course I wonder if there are any other RequiresApi-Annotation (or errors). So Android Studio is really clever and warns me. But I would prefer that I get a compiler error.

I was searching a while but I cannot find how to configure that. Does anybody know how can I prevent a successful compilation when there are so important annotation warnings/errors?

kuzdu
  • 7,124
  • 1
  • 51
  • 69
  • 1
    It's from lint. Debug builds don't usually have the lint step but you can add it. https://stackoverflow.com/questions/22850333/run-lint-when-building-android-studio-projects – laalto Apr 26 '22 at 13:13
  • So it's a duplicated questions. Thanks! I didn't found it or search for the wrong terms – kuzdu Apr 26 '22 at 14:08

1 Answers1

0

It's not a super solution. But you can just press Analyze -> Inspect Code -> Whole Project and in the output you see all errors.

enter image description here

kuzdu
  • 7,124
  • 1
  • 51
  • 69