当我在Android库模块中使用lambda表达式时,我收到编译器异常com.sun.tools.javac.code.Symbol$CompletionFailure: class file for java.lang.invoke.MethodType not found.
在Android应用程序模块中使用时,Lambda表达式正在编译时没有错误.
可以在此处找到演示此问题的示例项目:https:
//github.com/adamdye/AndroidLambdaIssue
示例中有趣的类是MyLibrary.java和MainActivity.java.每个类包含相同的表达式.
建立
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
Run Code Online (Sandbox Code Playgroud)
我对使用retro-lambda不感兴趣.我希望通过正确的配置来实现这一点.我想我在某个地方错过了一步.
lambda android android-library jack-compiler android-studio-2.2