当我使用lambda表达式时,为什么会出现此编译器错误?

时间:2016-10-25 03:28:07

标签: android android-studio lambda android-studio-2.2

我最近根据official instructions将我的Nougat项目迁移到Java 8,并用lambda表达式替换了一些OnClickListeners,但是当我构建apk时出现此错误:

An exception has occurred in the compiler (1.8.0_112). Please file a bug against the Java compiler via the Java bug reporting page (http://bugreport.java.com) after checking the Bug Database (http://bugs.java.com) for duplicates. Include your program and the following diagnostic in your report. Thank you.
com.sun.tools.javac.code.Symbol$CompletionFailure: class file for java.lang.invoke.MethodType not found
:keyboardLib:compileDebugJavaWithJavac FAILED

我很怀疑我发现了Java中的错误。我更有可能做错了什么。有人看过这个错误吗?

我正在使用Android Studio 2.2.1(支持lambdas),我尝试了包含的JDK以及最新的Oracle,1.8.0_112。我的设备和模拟器都运行Android 7.0或更高版本。

提前致谢...

0 个答案:

没有答案