0

I am trying to integrate Room database in my app. Compilation works fine but while I click the run button, I get No cached version of android.arch.persistence.room:compiler:1.1.0 available for offline mode error. I googled and found some solutions like unchecking offline option in gradle setting and removing --offline command from compiler settings. Nothing works. In my android studio the offline option in gradle setting was unchecked by default. I am not working behind a proxy network.

Here is my gradle dependencies section.

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    ...
    ...
    def room_version = "1.1.0" // or, for latest rc, use "1.1.1-rc1"

    implementation "android.arch.persistence.room:runtime:$room_version"
    annotationProcessor "android.arch.persistence.room:compiler:$room_version"

}

My project level gradle file

// Top-level build file where you can add configuration options common to all 
sub-projects/modules.

buildscript {

    repositories {
        jcenter()
        google()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.2'


        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
        google()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}
Suresh Kumar
  • 2,014
  • 3
  • 19
  • 32
  • I just went to the Android dev site, and it indicates that the latest version of Room is `1.0.0`, not `1.1.0`. – Leo Aso Jun 02 '18 at 09:35
  • 1
    Possible duplicate of [No cached version of com.google.gms:google-services:1.x.x available for offline mode](https://stackoverflow.com/questions/37747449/no-cached-version-of-com-google-gmsgoogle-services1-x-x-available-for-offline) – Jantzilla Jun 02 '18 at 09:38
  • I tried even with 1.0.0 @LeoAso – Suresh Kumar Jun 02 '18 at 09:42
  • @LeoAso the latest version in android developer site is 1.1.0. Check this link https://developer.android.com/topic/libraries/architecture/adding-components#room – Suresh Kumar Jun 02 '18 at 10:02

0 Answers0