k3b
k3b

Reputation: 14775

Is there an Android annotation (@RequiresApi >= xxx or desugared-library-version >= y.z)?

This is a follow-up-question to Is there an annotation that denotes a max Android API version?

Is there an Android annotation that produces a compiler error if neither @RequiresApi(xxx) nor @RequireCoreLibraryDesugaring("y.z") are met?

There is already an annotation @RequiresApi(xxx) that make the compile fail if minsdk is below xxx.

Since Android introduced library desugaring you can use methods that do not meet the @RequiresApi(xxx) if you add desugaring to you app, because desugar_jdk_libs adds the missing code, if necessary.

Under androidx.annotation I found nothing that meets my requirements

Upvotes: 0

Views: 910

Answers (0)

Related Questions