Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unresolved reference: Observable in Android Studio 3.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.

like image 915
Wrakor Avatar asked Dec 03 '22 18:12

Wrakor


2 Answers

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

like image 74
Alpesh Vaghasiya Avatar answered Dec 06 '22 11:12

Alpesh Vaghasiya


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
like image 26
Short Avatar answered Dec 06 '22 11:12

Short