Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Troubles with using MVICore while using RxJava 3.x. #128

@MairwunNx

Description

@MairwunNx

Error message providing me by IDEA:

Cannot access 'io.reactivex.ObservableSource' which is a supertype of 'com.example.androidbasics.fragments.FirstFragmentFeature'. 
Check your module classpath for missing or conflicting dependencies

And the same one more errors in same class but with different "can't access":

Cannot access 'io.reactivex.functions.Consumer'
Cannot access 'io.reactivex.disposables.Disposable' 

It also shown randomly, for example, I just formatter file or add any symbol and code analyzer do wakeup :).

Deps related probably to this issue:

    implementation "io.reactivex.rxjava3:rxkotlin:$rxkotlin_version"
    implementation "io.reactivex.rxjava3:rxandroid:$rxandroid_version"
    implementation "io.reactivex.rxjava3:rxjava:$rxjava_version"

where rxkotlin_version, rxandroid_version is 3.0.0 and rxjava_version is 3.0.4

Fragment state to reproduce (some lines formatted to in-line): it's pure boilerplate code

class FirstFragmentFeature : ReducerFeature<Wish, State, Nothing>(
    initialState = State(), reducer = ReducerImpl()
) {
    data class State(val counter: Int = 0)

    sealed class Wish {
        object IncreaseCounter : Wish()
        data class MultiplyBy(val value: Int) : Wish()
    }

    class ReducerImpl : Reducer<State, Wish> {
        override fun invoke(state: State, wish: Wish): State {
            return when (wish) {
                Wish.IncreaseCounter -> state.copy(counter = state.counter + 1)
                is Wish.MultiplyBy -> state.copy(counter = state.counter * wish.value)
            }
        }
    }
}

Installed mvicore dependencies (in app/build.gradle): used 1.2.4 version

    implementation "com.github.badoo.mvicore:mvicore:${mvicore_version}"
    implementation "com.github.badoo.mvicore:mvicore-android:${mvicore_version}"
    implementation "com.github.badoo.mvicore:mvicore-diff:${mvicore_version}"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions