Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Failed resolution of: Lcom/google/devtools/build/android/desugar/runtime/ThrowableExtension;

I'm using RxJava with Retrofit on the newest preview of AndroidStudio. My project has java 1.8 suport enabled like this:

compileOptions {
    targetCompatibility 1.8
    sourceCompatibility 1.8
}

But when the code is compiled and run I'm getting this error, as soon as the request is made, even if I have the onError handler:

java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/devtools/build/android/desugar/runtime/ThrowableExtension;
at io.reactivex.plugins.RxJavaPlugins.onError(RxJavaPlugins.java:281)
at retrofit2.adapter.rxjava2.CallExecuteObservable.subscribeActual(CallExecuteObservable.java:58)
at io.reactivex.Observable.subscribe(Observable.java:10179)
at retrofit2.adapter.rxjava2.BodyObservable.subscribeActual(BodyObservable.java:34)
at io.reactivex.Observable.subscribe(Observable.java:10179)
at io.reactivex.internal.operators.flowable.FlowableFromObservable.subscribeActual(FlowableFromObservable.java:31)
at io.reactivex.Flowable.subscribe(Flowable.java:12218)
at io.reactivex.internal.operators.flowable.FlowableOnBackpressureLatest.subscribeActual(FlowableOnBackpressureLatest.java:31)
at io.reactivex.Flowable.subscribe(Flowable.java:12218)

This happens even if I use Maybe, Single or Observable. How can this issue be resolved?

like image 915
user_4685247 Avatar asked May 22 '17 11:05

user_4685247


1 Answers

This is in fact not RxJava error neither Retrofit. It is Instant run error, i disabled it and my app launched.

As a temporary solution, you can disable Instant run, too.

To do it, go to Build, Execution, Development -> Instant Run in Settings.

like image 131
Nikita Kraev Avatar answered Oct 14 '22 08:10

Nikita Kraev