Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NoSuchMethodError from RxJava3 #366

Closed
linzhengloser opened this issue Aug 2, 2019 · 2 comments
Closed

NoSuchMethodError from RxJava3 #366

linzhengloser opened this issue Aug 2, 2019 · 2 comments

Comments

@linzhengloser
Copy link

hi, i use RxJava3+ AutoDipose an exception occurred。

 java.lang.NoSuchMethodError: No static method defer(Ljava/util/concurrent/Callable;)Lio/reactivex/Completable; in class Lio/reactivex/Completable; or its super classes (declaration of 'io.reactivex.Completable' appears in /data/app/com.lz.baselibrary-s92eLHoY-Uw_t6flDFrNsQ==/split_lib_dependencies_apk.apk)
        at com.uber.autodispose.AutoDispose.autoDisposable(AutoDispose.java:81)
        at com.lz.baselibrary.ui.MainActivity.onCreate(MainActivity.kt:107)
        at android.app.Activity.performCreate(Activity.java:7340)
        at android.app.Activity.performCreate(Activity.java:7331)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1275)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3106)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3269)
        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1960)
        at android.os.Handler.dispatchMessage(Handler.java:106)
............ omit

this is my version info:

api 'io.reactivex.rxjava3:rxjava:3.0.0-RC1'
api 'io.reactivex.rxjava2:rxandroid:2.1.1'
api('com.uber.autodispose:autodispose-ktx:1.2.0') {
       exclude group: 'io.reactivex.rxjava2'
       exclude group: 'io.reactivex.rxjava2:rxandroid'
}
api('com.uber.autodispose:autodispose-android-ktx:1.2.0') {
        exclude group: 'io.reactivex.rxjava2'
        exclude group: 'io.reactivex.rxjava2:rxandroid'
}
api('com.uber.autodispose:autodispose-android-archcomponents-ktx:1.2.0') {
        exclude group: 'io.reactivex.rxjava2'
        exclude group: 'io.reactivex.rxjava2:rxandroid'
}

this is my code:

Observable.interval(2, TimeUnit.SECONDS)
        .autoDisposable(AndroidLifecycleScopeProvider.from(this, Lifecycle.Event.ON_PAUSE))
        .subscribe {
          Timber.d("interval $it")
        }

When I switched the version of RxJava to 2.2.8, there was no such exception.

@ZacSweers
Copy link
Collaborator

RxJava 3 is not supported for kotlin extensions right now, please follow #359

@ZacSweers
Copy link
Collaborator

Oh wait this is defer. Ugh, another breaking change then. Will keep this folded into the aforementioned issue though and update it with this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants