Search code examples
androidsqlitegradleandroid-roomandroid-architecture-components

gradle can not resolve room version 2.3.0


i have just changed the room library's version and gradle can not resolve it.

this is my repositories :

allprojects {
    repositories {
        mavenCentral()
        google()
        jcenter()
        maven { url 'https://jitpack.io' }
    }
}

and build.gradle:

implementation "androidx.room:room-runtime:2.3.0"
kapt  "androidx.room:room-compiler:2.3.0"
implementation "androidx.room:room-ktx:2.3.0"

here's build log:

Failed to resolve: room-runtime-2.3.0
Failed to resolve: sqlite-framework-2.1.0
Failed to resolve: room-common-2.3.0
Failed to resolve: annotation-experimental-1.1.0
Failed to resolve: room-ktx-2.3.0
Failed to resolve: sqlite-2.1.0

How can I solve this problem? thanks in advance


Solution

  • There was no problem with room, it was because of Android Studio's cache. To solve the problem I deleted these 2 directories:

    1. Build directory located in project's root directory
    2. Build directory located in app directory