4
Error:Could not resolve all files for configuration ':app:debugAnnotationProcessorClasspath'. Could not resolve android.arch.persistence.room:compiler:1.0.0. Required by: project :app No cached version of android.arch.persistence.room:compiler:1.0.0 available for offline mode. No cached version of android.arch.persistence.room:compiler:1.0.0 available for offline mode. No cached version of android.arch.persistence.room:compiler:1.0.0 available for offline mode. No cached version of android.arch.persistence.room:compiler:1.0.0 available for offline mode. No cached version of android.arch.persistence.room:compiler:1.0.0 available for offline mode. No cached version of android.arch.persistence.room:compiler:1.0.0 available for offline mode. No cached version of android.arch.persistence.room:compiler:1.0.0 available for offline mode. No cached version of android.arch.persistence.room:compiler:1.0.0 available for offline mode. 

Room gradle dependecies

implementation "android.arch.persistence.room:runtime:1.0.0" annotationProcessor "android.arch.persistence.room:compiler:1.0.0" 

Offline mode and build cache are disabled. Gradle version 4.1 Gradle project file

buildscript { repositories { google() jcenter() } dependencies { classpath 'com.android.tools.build:gradle:3.0.1' classpath 'com.google.gms:google-services:3.1.1' } } 
6
  • Did you add google() as maven dependency to your project? Commented Jan 19, 2018 at 12:50
  • @Christopher yes Commented Jan 19, 2018 at 12:52
  • 1
    Did u tried Invalidate cache and restart. Invalidate Cache by tapping File-> option in android studio Commented Jan 19, 2018 at 13:14
  • @lib4 cache invalidating not helps. Strange, gradle sync successful, but when I trying to Make Project this error occurs Commented Jan 19, 2018 at 13:30
  • please add google() also in the project-repository section, not only in the buildscript section. Commented Jan 19, 2018 at 13:46

3 Answers 3

2

Could not resolve android.arch.persistence.room:compiler:1.0.0

To add it to your project, open the build.gradle file for your project (Project Level) and add the highlighted line as shown below:

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

DEMO

// Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { repositories { google() jcenter() } dependencies { classpath 'com.android.tools.build:gradle:3.0.1' } } allprojects { repositories { google() jcenter() } } task clean(type: Delete) { delete rootProject.buildDir } 

Kindly read Adding Components to your Project

Sign up to request clarification or add additional context in comments.

1 Comment

+ File -> Settings -> Build, Execution... -> Compiler -> add command --refresh-dependencies
2

It seems that you might be using Offline mode in your Android Studio. To disable Offline mode:

  1. Make sure your machine is connected to the internet.
  2. Go to File -> Settings & expand Build, Execution, Deployment -> Gradle -> UNCHECK Offline work -> OK
  3. Go to File -> click on Invalidate Caches / Restart -> Invalidate & Restart
  4. Done

1 Comment

Invalidating the cache and restarting was enough for me.
0

Add google() maven repo to your project (two occurences):

buildscript { repositories { google() jcenter() } dependencies { classpath 'com.android.tools.build:gradle:3.0.1' classpath 'com.google.gms:google-services:3.1.1' } } allprojects { repositories { google() // Your other Maven Repos } } 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.