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.
房间依赖
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'
}
}
答案 0 :(得分:2)
无法解析android.arch.persistence.room:compiler:1.0.0
要将其添加到项目中,请打开项目 build.gradle
的 (Project Level)
文件,然后添加突出显示的行,如下所示:< / p>
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
}
答案 1 :(得分:1)
您可能在Android Studio中使用离线模式。要停用离线模式:
答案 2 :(得分:0)
将google()
maven repo添加到您的项目中(两次出现):
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
}
}