java.lang.NoClassDefFoundError:lambda与Android API 23

java.lang.NoClassDefFoundError:lambda与Android API 23,android,lambda,java-8,method-reference,retrolambda,Android,Lambda,Java 8,Method Reference,Retrolambda,我想在Android API 23上使用方法引用,我被卡住了。 我尝试了retrolambda和其他一些方法,但仍然不起作用 RequestClass.doRequestWithApi(this.getApplicationContext(), this.TAG, dataToPass, this::getMyAccount); 我正在使用Java8并在SDK26上编译(Min23) 这是错误 E/MultiWindowProxy: getServiceInstance failed! E/A

我想在Android API 23上使用方法引用,我被卡住了。 我尝试了retrolambda和其他一些方法,但仍然不起作用

RequestClass.doRequestWithApi(this.getApplicationContext(), this.TAG, dataToPass, this::getMyAccount);
我正在使用Java8并在SDK26上编译(Min23)

这是错误

E/MultiWindowProxy: getServiceInstance failed!
E/AndroidRuntime: FATAL EXCEPTION: main
                  Process: etsymbiose.defdress, PID: 8296
                  java.lang.NoClassDefFoundError: etsymbiose.defdress.LoginActivity$$Lambda$1
                      at etsymbiose.defdress.LoginActivity.onCreate(LoginActivity.java:51)
                      at android.app.Activity.performCreate(Activity.java:6301)
                      at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1113)
                      at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2519)
                      at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2654)
                      at android.app.ActivityThread.-wrap11(ActivityThread.java)
                      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1488)
                      at android.os.Handler.dispatchMessage(Handler.java:111)
                      at android.os.Looper.loop(Looper.java:207)
                      at android.app.ActivityThread.main(ActivityThread.java:5728)
                      at java.lang.reflect.Method.invoke(Native Method)
                      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789)
                      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:679)

有没有办法让这项工作正常进行?

您是否在使用proguard从项目中删除未使用的代码?我记得proguard没有“看到”
this::getMyAccount
作为对
getMyAccount
方法的引用,所以它可能是在删除它。我没有使用proguard,所以我猜它是另外一回事。但是,这段代码在我朋友的手机(API 24)上运行。请发布准确的错误消息。您使用的是什么版本的
Android Gradle插件
。从3.0开始,
retrolambda
不再是必需的:Gradle版本4.1和Android插件版本3.0.1,但无论是否使用retrolambda,它都不起作用