I used java.time.Duration.toMinutesPart() method in my Android project targeting SDK 31 and from the IDE/compiler point of view everything was fine, on my emulator/device with Android 12 the app worked but then I've noticed crashes on our testing devices running lower Android versions
Fatal Exception: java.lang.NoSuchMethodError
No virtual method toMinutesPart()I in class Lj$/time/Duration; or its super classes (declaration of 'j$.time.Duration' appears in base.apk!classes2.dex)
I've checked the doc of the method and I've noticed that the method was added in Java 9 so the crash makes sense but what bothers me is that no part of the build pipeline (IDE, compiler, lint) warned me about using this method and now I'm scared how many methods I might be using that may crash in production. Is there any way to prevent this? I am using Kotlin and desugaring plugin

