I get call requires api level X in non-android modules when using Java 8 functions. How to remove it. Suppressing with annotation doesn't seem to me the right way
call requires api level X
https://developer.android.com/guide/platform/j8-jack.html
Android supports all Java 7 language features and a set of Java 8 language features that vary by platform version.To support Java 8 language features, a new Jack compiler is required. Jack is only supported on Android Studio 2.1 and higher.Android does not support all the features of the Java 8 language. However, when developing applications oriented to Android 7.0 (API level 24) , the following functions are available:Default Methods and Static InterfacesLambda expressions (also available at API level 23 and below)Duplicate annotationsMethod references (also available at API level 23 and below)Sample annotations (also available at API level 23 and below)
Android supports all Java 7 language features and a set of Java 8 language features that vary by platform version.
To support Java 8 language features, a new Jack compiler is required. Jack is only supported on Android Studio 2.1 and higher.
Android does not support all the features of the Java 8 language. However, when developing applications oriented to Android 7.0 (API level 24) , the following functions are available:
... I have an emphasis.