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?

2
  • 2
    Maybe this thread will help you? stackoverflow.com/questions/70448390/… Commented Jun 30, 2023 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. Commented Jun 30, 2023 at 16:09

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.