ReactiveX / RxJava

RxJava – Reactive Extensions for the JVM – a library for composing asynchronous and event-based programs using observable sequences for the Java VM.
Apache License 2.0
47.88k stars 7.61k forks source link

android studio 3.1 compile failed #5945

Closed ghost closed 6 years ago

ghost commented 6 years ago

Thanks for using RxJava but before you post an issue, please consider the following points:

implementation 'io.reactivex.rxjava2:rxandroid:2.0.2' implementation 'io.reactivex.rxjava2:rxjava:2.1.12'

e: Supertypes of the following classes cannot be resolved. Please make sure you have the required dependencies in the classpath:

subclass can not be resolve;

import com.nxg.gallery.utils.Logger; import io.reactivex.observers.DisposableObserver;

public abstract class RxBusDisposable extends DisposableObserver {

@Override
public void onNext(T t) {
    try {
        onEvent(t);
    } catch (Exception e) {
        e.printStackTrace();
        onError(e);
    }
}

@Override
public void onComplete() {

}

@Override
public void onError(Throwable e) {
    Logger.e(e.getMessage());
}

protected abstract void onEvent(T t) throws Exception;

}

akarnokd commented 6 years ago

This is not a problem with RxJava but with your project setup inside Android Studio. Please make sure you are using all the dependecies and the correct inclusion mode.