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.
房间gradle依赖
implementation "android.arch.persistence.room:runtime:1.0.0"
annotationProcessor "android.arch.persistence.room:compiler:1.0.0"
离线模式和构建缓存被禁用。 Gradle 版本 4.1 Gradle项目文件
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.google.gms:google-services:3.1.1'
}
}
最佳答案
Could not resolve android.arch.persistence.room:compiler:1.0.0
要将它添加到您的项目中,请为您的项目打开 build.gradle
文件 (Project Level)
并添加突出显示的行,如下所示:
allprojects {
repositories {
jcenter()
google()
}
}
演示
// 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
}
关于Android RoomDatabase - 无法解析 android.arch.persistence.room :compiler:1. 0.0,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48341513/