androidkotlingradleintellij-idea

Unexpected tokens (use ';' to separate expressions on the same line) in build.gradle.kts when i add rxjava and rxkotlin


i can not add rxjava and rxkotlin to build.gradle.kts in intellij-idea and it shows error like this

enter image description here

what i have to do? i don't understand


Solution

  • You have a .kts ( Kotlin script ) file, implementation is a kotlin function here, and the dependency should be passed as an argument to it.

    implementation ("io.reactivex.rxjava3:rxjava:3.1.5")
    implementation ("io.reactivex.rxjava3:rxkotlin:3.0.1")