When I use a lambda expression in an Android Library Module, I receive a compiler exception com.sun.tools.javac.code.Symbol$CompletionFailure: class file for java.lang.invoke.MethodType not found
.
Lambda expressions are compiling without error when used in the Android application module.
A sample project to demonstrate the problem can be found here:
https://github.com/adamdye/AndroidLambdaIssue
The interesting classes in the example are MyLibrary.java and MainActivity.java. Each class contains the identical expressions.
Setup
Android Studio 2.2 preview 1
min/target SDK version = android-N
build tools version = 24.0.0.rc4
jack compiler enabled
source/target compatibility = 1.8
Gradle version = 2.10
Android Plugin Version = 2.2.0-alpha1
JDK = java 8
I am not interested in using retro-lambda. I'd like to get this working through proper configuration. I assume I'm missing a step somewhere.