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

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

Open
MairwunNx opened this issue Jul 24, 2020 · 1 comment
Open

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

MairwunNx opened this issue Jul 24, 2020 · 1 comment

Comments

@MairwunNx
Copy link

MairwunNx commented Jul 24, 2020

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}"
@MairwunNx
Copy link
Author

MairwunNx commented Jul 24, 2020

When I tried to compile with that error I got this:

C:\...\android.basics\app\build\tmp\kapt3\stubs\debug\com\example\androidbasics\fragments\FirstFragmentFeature.java:6: error: cannot access Consumer
public final class FirstFragmentFeature extends com.badoo.mvicore.feature.ReducerFeature {
             ^
  class file for io.reactivex.functions.Consumer not found C:\...\android.basics\app\build\tmp\kapt3\stubs\debug\com\example\androidbasics\fragments\FirstFragmentFeature.java:13: error: cannot access ObservableSource
    public static final class State {
                        ^
  class file for io.reactivex.ObservableSource not found C:\...\android.basics\app\build\tmp\kapt3\stubs\debug\com\example\androidbasics\fragments\FirstFragmentFeature.java:56: error: cannot access Disposable
    public static abstract class Wish {
                           ^

and this: A failure occurred while executing org.jetbrains.kotlin.gradle.internal.KaptExecution

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

1 participant