4

Updated to Android Studio 3.4, with Gradle 5.1.1 and Kotlin 1.3.10 as minimum versions. Cannot run project anymore due to reactivex.Observable not being found. Has anyone found a solution?

Was using rxBinding lib, also tried using latest vesions RxJava 2.2.8 and RxAndroid 2.1.1 with no success.

Zoe
  • 27,060
  • 21
  • 118
  • 148
Wrakor
  • 113
  • 1
  • 7

5 Answers5

5

Downgrading the build.gradle(project) from classpath 'com.android.tools.build:gradle:3.4.0' to classpath 'com.android.tools.build:gradle:3.2.1' might be help you

Alpesh Vaghasiya
  • 176
  • 1
  • 2
  • 10
5

The issue is that you need to use RxJava 2.2.8 and if you check the RxAndroid gradle file they are using the RxJava version 2.2.6 :

https://github.com/ReactiveX/RxAndroid/blob/2.x/rxandroid/build.gradle

If you force RxJava to use version 2.2.8 it will work.

Add to gradle:

implementation 'io.reactivex.rxjava2:rxjava:2.2.8
Short
  • 313
  • 5
  • 12
  • 1
    worked for me, my project was using rxjava2 from a sub module. I needed to declare rxjava2 in the main app's build.gradle. – frey Jul 01 '19 at 06:24
3

Yeah the workaround* for me was to downgrade from gradle 5.1.1 to 4.10.1 and also to the latest android gradle plugin prior to 3.4.0, which is 3.3.2.

I did this in gradle/wrapper/gradle-wrapper.properties by changing to the following: distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip

I then also changed the following in my root build.gradle file:

'com.android.tools.build:gradle:3.4.0' to 'com.android.tools.build:gradle:3.3.2'

Justin T
  • 94
  • 3
2

Along with the dependency of RxKotlin use this

api 'io.reactivex.rxjava2:rxjava:2.2.0'

Only works for Gradle 5.0 or above

1

The accepted answer ended up leading me to the solution: leaving the gradle-wrapper.properties intact and don't increase the gradle version at all. We'll see if a future lib update will solve it for gradle 3.4.

Wrakor
  • 113
  • 1
  • 7