Beginning RxKotlin · Subscribing to Observables, Part 1 |

This is a companion discussion topic for the original entry at

doesn’t seem to be trivial to open these starter projects in intellij. it cant find the main class. doesnt seem to be selectable in configurations AND gradle doesn’t seem to be getting recognised?

Hi @eoin_a thanks for the question!

It seems like the projects are not working well with recent versions of IntelliJ IDEA. Your best bet is to follow these steps if you continue to have an issue:

  1. Create a new Gradle project in IntelliJ IDEA and select Kotlin/JVM when creating the project.
  2. Copy the files main.kt and SupportCode.kt from the download materials into your new project, in the src/main/kotlin folder.
  3. Add these lines to your new project build.gradle file:
    implementation "io.reactivex.rxjava2:rxjava:2.2.7"
    implementation "io.reactivex.rxjava2:rxkotlin:2.2.0"
  1. Select “Import changes” on the Gradle popup you see when you edit build.gradle.

You should be able to run the code then without issue. Let me know if that works out!

i managed to import the project! cheers.

  1. open project. (didn’t actually import the project)
  2. file -> project structure -> modules -> set “src/main/kotlin” to source type folder. (blue color)
  3. in terminal “gradlew build” and the rx library should import.

Great news, thanks for the update @eoin_a!

1 Like

cheers for the help!