Java functional interfaces on Android


#1

Is it possible to use functional interface (like java.util.function.Function) in Java code in Kotlin- Android development?
Problem: Parts of my project contain Java classes that use java.util.function.Function to pass lambdas from Kotlin to Java code. Google states here that functional interfaces are supported on Android with the Jack toolchain. But Gradle says that the Kotlin plugin does not support the Jack toolchain. So looks like while developing on Kotlin i can’t use Java 8 features in Java code, functional interfaces in particular. Or am i getting something wrong about it?


#2

Jack is deprecated, no need to worry about it anymore. New Java 8 support in default toolchain should work with Kotlin without problems, you can try - https://developer.android.com/studio/write/java8-support.html
If you still have some problems I think you could create an issue on Android Bug Tracker