RxKotlin icon indicating copy to clipboard operation
RxKotlin copied to clipboard

RxKotlin is not resolved properly after updating Gradle to 3.4.0

Open AndroidPat opened this issue 5 years ago • 17 comments

Hi, The new stable version of Android Studio suggest to update Gradle to 3.4.0 to get all the latest benefits.

After updating my Gradle from 3.3.2 ( wrapper 4.10.1 ) to 3.4.0 ( wrapper 5.1.1 ) the library is not resolved properly. That means all the references to rxKotlin in my project are not resolved. The behaviour is similar to commenting out the dependency in build.gradle.

Error examples:

  • Unresolved reference: CompositeDisposable
  • Unresolved reference: BehaviorSubject
  • Unresolved reference: subjects library reference: implementation 'io.reactivex.rxjava2:rxkotlin:2.3.0' kotlin gradle plugin version: '1.3.31'

Steps to fix:

  • project clean
  • cache removal
  • invalidate caches + restart
  • remove build folder
  • try in a different project

AndroidPat avatar May 02 '19 13:05 AndroidPat

Same problem here with gradle plugin 3.4.1 and gradle wrapper 5.1.1. Also tried with gradle wrapper version 5.4.1 without luck.

BaN4NaJ0e avatar May 20 '19 12:05 BaN4NaJ0e

Same issue here, I'm back to Gradle plugin 3.3.0 and Gradle wrapper 4.10.3

milser avatar May 30 '19 13:05 milser

Hi all, thanks for reporting the issue. I've been crazy busy these days and I'll try to get back to the Rx libraries I own soon.

thomasnield avatar May 30 '19 14:05 thomasnield

Same issue here, I'm back to Gradle plugin 3.3.0 and Gradle wrapper 4.10.3

This helped. Thank you!!

nayan-dhabarde avatar Jun 09 '19 06:06 nayan-dhabarde

Thanks for posting this, I've been stuck on this for a few days. I appreciate it!

cgathergood avatar Jun 09 '19 10:06 cgathergood

If you are still facing this issue, along with the dependency of rxKotlin use this

implementation 'io.reactivex.rxjava2:rxkotlin:x.y.z'
api 'io.reactivex.rxjava2:rxjava:2.2.0'

Only works for Gradle 5.0 or above. (If I am not wrong)

erluxman avatar Jun 10 '19 01:06 erluxman

Is it planned some fix for this? Solutions here does not work for me

FireZenk avatar Jun 26 '19 07:06 FireZenk

@FireZenk RxKotlin 2.4.0-beta.1 has just been released. Can you try it out and post a feedback whether the issue still persists or is gone?

vpriscan avatar Jun 28 '19 20:06 vpriscan

@FireZenk RxKotlin 2.4.0-beta.1 has just been released. Can you try it out and post a feedback whether the issue still persists or is gone?

I tried yesterday with this project, which uses RxKotlin version 2.1.0, and it's still not working.

Here are dependencies I am using, RxKotlin : 2.1.0 RxAndroid : 2.0.1 Android Studio : 3.4.1 Kotlin : 1.3.40

For time being, I added io.reactivex.rxjava2:rxjava:2.0.2 to compile the project 👍

mamatagelanee07 avatar Jun 30 '19 09:06 mamatagelanee07

@FireZenk RxKotlin 2.4.0-beta.1 has just been released. Can you try it out and post a feedback whether the issue still persists or is gone?

issue is still there

RxKotlin : 2.4.0-beta.1 RxJava : 2.2.10 Android Studio : 3.5.0-beta5 Kotlin : 1.3.40

Jacks0N23 avatar Jul 02 '19 13:07 Jacks0N23

I too have this problem. Basic classes aren't being found like Single. The includes don't work. The IDE is able to read the cache but and find the Single declaration but the kotlin compiler can't. When I look at the tool bar, I noticed the cache is pointing to a cache directory titled file-2.1. I make an app and morphdevapp and they both fail. Maybe it should point to 2.2?

RScottLewis avatar Jul 02 '19 16:07 RScottLewis

Workaround: it works correctly with named params UPD: it was fixed by latest Kotlin plugin

Jacks0N23 avatar Jul 03 '19 15:07 Jacks0N23

Which version of Kotlin Plug-In are you using?

mamatagelanee07 avatar Jul 24 '19 13:07 mamatagelanee07

1.3.50

Jacks0N23 avatar Oct 09 '19 09:10 Jacks0N23

@Jacks0N23 Trying with plug-in 1.3.61, not working yet!

mamatagelanee07 avatar Feb 01 '20 11:02 mamatagelanee07

What AGP version? Since 3.5 it's working good

Jacks0N23 avatar Feb 19 '20 09:02 Jacks0N23

subscribeBy removed onNext? onComplete?

yourshinsuke avatar Jul 01 '20 08:07 yourshinsuke