1

When I was trying to upgrade my Android Studio to 3.4, the update does not go smoothly rather, some dependencies break. In my case, the RxJava/RxKotlin dependencies are breaking without giving any clue. Even that is happening randomly as I have RxJava/RxKotlin Code in each of my 4 modules but the dependency is failing in only one module.

enter image description here

What I tried :

  1. Invalidate Cache and restart.
  2. Delete /build *module/build/ *module/.gradle/ & .gradle/
  3. Clean Project
  4. Try find answers on the internet and these are the closest but does not solve the problem. (They did not recommend to upgrade to 3.4)

    i) Unresolved reference: Observable in Android Studio 3.4 Explains the problem I have but the thread is moving to either not upgrading the Gradle (Which is last option for me) or making sure RxJava that is being used in the project or any of its library is 2.2.8). For that reason I tried explicitly adding RxJava 2.2.8 (I was not previously as I was getting it inside RxKotlin) and wrote a resolutionStrategy to force Android studio to use RxJava 2.2.8 like this in that particular module i.e. domain, but did not solve the issue :

    configurations.all {
           resolutionStrategy.force 'io.reactivex.rxjava2:rxjava:2.2.8'
    }
    

    ii) RxKotlin is not resolved properly after updating Gradle to 3.4.0 which does not yet give any solution. And I am even suspicious if it's the issue with RxJava/RxKotlin or the Gradle plugin itself. Or even if it's the case with RxKotlin or any other libraries too.

Edit: My dependencies in domain module looks like this :

dependencies {
    implementation Deps.kotlinStdLib
    implementation Deps.rxKotlin
    implementation Deps.dagger
    implementation Deps.timber
    implementation Deps.mobiusCore
    implementation Deps.mapboxGeoJSONCore
}
halfer
  • 19,824
  • 17
  • 99
  • 186
erluxman
  • 18,155
  • 20
  • 92
  • 126
  • this is barely reproducible without the `dependencies`. something in that module's `build.gradle` may be different than the others... most likely it's related to `api` vs. `implementation`. the package name is actually `io.reactivex.rxjava2:rxkotlin`. – Martin Zeitler Jun 01 '19 at 03:08
  • Yeah I know the package name, I am mentioning rxJava/rxKotlin because I am not sure if it's the issue with the version of RxJava or RxKotlin if it's not of gradle plugin. I even Copy Pasted the dependencies of the module that's working to that's not working.. still no luck.. I have updated the question to reflect my list of dependencies in that module. – erluxman Jun 01 '19 at 03:14

1 Answers1

0

try to add rxkotlin to the dependencies (if not already added):

dependencies {

    // rxKotlin ...is likely missing
    implementation "io.reactivex.rxjava2:rxkotlin:2.3.0"

    // rxJava:
    implementation "io.reactivex.rxjava2:rxjava:2.2.0"

    // rxAndroid bindings:
    implementation "io.reactivex.rxjava2:rxandroid:2.1.0"
}
Martin Zeitler
  • 1
  • 19
  • 155
  • 216