0

I have an Android app and I'm trying to make it working on an older device.

I decreased the minSdk in the build.gradle file and it compiles fine but when I run it, it crashes because of Call requires API level 24 (current min is 22): java.util.List#sort.

I tried to add @RequiresApi(N) annotation hoping to be able to detect all these errors at compile time but it is not.

Is there a smart solution to quickly find out all them?

Luca
  • 13
  • 4
  • 2
    Maybe this thread will help you? https://stackoverflow.com/questions/70448390/call-requires-api-level-24-java-util-comparator – Arturr300 Jun 30 '23 at 14:52
  • To simply discover at compile-time all of your API-sensitive code, then temporarily set minSdk, targetSdk and compileSdk to same number (22 in this case) and rebuild. Then address each error as needed. – Computable Jun 30 '23 at 16:09

0 Answers0