Reputation: 454
I am trying to use Kotlin coroutines in conjunction with Room database. I've heavily referenced the official Room docs to achieve this. When I add the first two lines:
implementation "androidx.room:room-runtime:$room_version"
kapt "androidx.room:room-compiler:$room_version"
in dependencies{}
, everything is working perfectly.
However, when I try to add the 3rd dependency implementation androidx.room:room-ktx:$room_version
, all of a sudden my build fails and I get the following error:
Unable to resolve dependency for ':common@debugAndroidTest/compileClasspath': Could not resolve androidx.room:room-ktx:2.2.5.
I've tried cleaning the project and invalidate cache + restart, but the problem persists.
Below is my current setup. Can anyone tell me what I am missing? Thanks!
allprojects {
repositories {
google()
jcenter()
}
}
apply plugin: 'kotlin-kapt'
dependencies {
def room_version = "2.2.5"
implementation "androidx.room:room-runtime:$room_version"
kapt "androidx.room:room-compiler:$room_version"
implementation "androidx.room:room-ktx:$room_version"
}
Upvotes: 1
Views: 5739
Reputation: 11
you need add classpath in Project Gradle.
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.21"
}
Upvotes: 1