更新为Gradle 3.0.0-alpha1时,没有静态方法lambda $ onGoogleApiClientReady $ 0

时间:2017-05-24 16:08:09

标签: android android-studio lambda rx-java

使用gradle 3.0.0迁移到最新的Android O后,我遇到了这个错误:

java.lang.NoSuchMethodError: No static method lambda$onGoogleApiClientReady$0(Lcom/patloew/rxlocation/SettingsCheckHandleSingleOnSubscribe;Lio/reactivex/SingleEmitter;Lcom/google/android/gms/location/LocationSettingsResult;)V in class Lcom/patloew/rxlocation/SettingsCheckHandleSingleOnSubscribe; or its super classes (declaration of 'com.patloew.rxlocation.SettingsCheckHandleSingleOnSubscribe' appears in /data/app/com.appx.app.debug-1/base.apk)
                                                          at com.patloew.rxlocation.SettingsCheckHandleSingleOnSubscribe$$Lambda$1.onResult(Unknown Source)
                                                          at com.google.android.gms.internal.zzaaf$zza.zzb(Unknown Source)
                                                          at com.google.android.gms.internal.zzaaf$zza.handleMessage(Unknown Source)
                                                          at android.os.Handler.dispatchMessage(Handler.java:102)
                                                          at android.os.Looper.loop(Looper.java:154)
                                                          at android.app.ActivityThread.main(ActivityThread.java:6121)
                                                          at java.lang.reflect.Method.invoke(Native Method)
                                                          at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:889)
                                                          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:779)a

我的Gradle文件:

  defaultConfig {
...
    vectorDrawables.useSupportLibrary = true


    javaCompileOptions {
      annotationProcessorOptions {
        includeCompileClasspath false
      }
    }

  }

1 个答案:

答案 0 :(得分:0)

在删除rtrolambda之后,该库的维护者是aware此错误,并建议降级Android Studio的版本并使用稳定版本。

如果您不想继续使用Android Studio 3,请使用此分支:

 implementation 'com.github.joharei:RxLocation:master-SNAPSHOT'