我有一个下一个项目结构:
+--
| \-- app
| \-- my-lib
我向my-lib
添加了依赖项:
implementation "android.arch.persistence.room:runtime:2.1.0-alpha02"
kapt "android.arch.persistence.room:compiler:2.1.0-alpha02"
我尝试访问@DatabaseView
,但发现它不存在
在构思中查看“外部库”选项卡时,我发现 2.1.0-alpha02 被 2.0.0-rc01
我试图找到它的来源,但是没有地方可以添加它
我尝试了./gradlew clean --refresh-dependencies --debug
,甚至找不到 2.1.0-alpha02
的提法
Gradle事件不会尝试解决它,但会解决 2.0.0-rc01 :
16:08:17.414 [DEBUG] [org.gradle.internal.progress.DefaultBuildOperationExecutor] Build operation 'Resolve androidx.room:room-runtime:2.0.0-rc01' started
16:08:17.415 [DEBUG] [org.gradle.api.internal.artifacts.repositories.resolver.DefaultExternalResourceArtifactResolver] Loading file:/var/local/android-sdk/extras/m2repository/org/jetbrains/kotlin/kotlin-stdlib-jdk7/1.2.71/kotlin-stdlib-jdk7-1.2.71.pom
16:08:17.414 [DEBUG] [org.gradle.internal.work.DefaultWorkerLeaseService] Build operation root.1.81.85 could not be started (4 worker(s) in use).
16:08:17.415 [DEBUG] [org.gradle.api.internal.artifacts.repositories.resolver.DefaultExternalResourceArtifactResolver] Loading file:/var/local/android-sdk/extras/m2repository/org/jetbrains/kotlin/kotlin-stdlib-jdk7/1.2.71/kotlin-stdlib-jdk7-1.2.71.jar
16:08:17.414 [DEBUG] [org.gradle.api.internal.artifacts.repositories.resolver.DefaultExternalResourceArtifactResolver] Loading file:/var/local/android-sdk/extras/m2repository/org/jetbrains/kotlin/kotlin-android-extensions-runtime/1.2.71/kotlin-android-extensions-runtime-1.2.71.pom
16:08:17.415 [DEBUG] [org.gradle.api.internal.artifacts.repositories.resolver.ExternalResourceResolver] No meta-data file or artifact found for module 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.2.71' in repository '/var/local/android-sdk/extras/m2repository'.
16:08:17.415 [DEBUG] [org.apache.http.client.protocol.RequestAddCookies] CookieSpec selected: default
16:08:17.415 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.ivyresolve.RepositoryChainComponentMetaDataResolver] Attempting to resolve component for androidx.room:room-runtime:2.0.0-rc01 using repositories [/var/local/android-sdk/extras/m2repository, /var/local/android-sdk/extras/google/m2repository, /var/local/android-sdk/extras/android/m2repository, Google, BintrayJCenter, MavenRepo]
16:08:17.415 [DEBUG] [org.gradle.api.internal.artifacts.repositories.resolver.DefaultExternalResourceArtifactResolver] Loading file:/var/local/android-sdk/extras/m2repository/androidx/room/room-runtime/2.0.0-rc01/room-runtime-2.0.0-rc01.pom
16:08:17.415 [DEBUG] [org.gradle.api.internal.artifacts.repositories.resolver.DefaultExternalResourceArtifactResolver] Loading file:/var/local/android-sdk/extras/m2repository/androidx/room/room-runtime/2.0.0-rc01/room-runtime-2.0.0-rc01.jar
16:08:17.415 [DEBUG] [org.apache.http.client.protocol.RequestAuthCache] Auth cache not set in the context
16:08:17.415 [DEBUG] [org.gradle.api.internal.artifacts.repositories.resolver.DefaultExternalResourceArtifactResolver] Loading file:/var/local/android-sdk/extras/m2repository/org/jetbrains/kotlin/kotlin-android-extensions-runtime/1.2.71/kotlin-android-extensions-runtime-1.2.71.jar
16:08:17.415 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.modulecache.DefaultModuleMetadataCache] Recording absence of module descriptor in cache: org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.2.71 [changing = false]
16:08:17.415 [DEBUG] [org.gradle.api.internal.artifacts.repositories.resolver.ExternalResourceResolver] No meta-data file or artifact found for module 'org.jetbrains.kotlin:kotlin-android-extensions-runtime:1.2.71' in repository '/var/local/android-sdk/extras/m2repository'.
16:08:17.415 [DEBUG] [org.apache.http.impl.conn.PoolingHttpClientConnectionManager] Connection request: [route: {s}->https://dl.google.com:443][total kept alive: 0; route allocated: 0 of 20; total allocated: 0 of 20]
16:08:17.415 [DEBUG] [org.gradle.api.internal.artifacts.repositories.resolver.ExternalResourceResolver] No meta-data file or artifact found for module 'androidx.room:room-runtime:2.0.0-rc01' in repository '/var/local/android-sdk/extras/m2repository'.
16:08:17.415 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.modulecache.DefaultModuleMetadataCache] Recording absence of module descriptor in cache: androidx.room:room-runtime:2.0.0-rc01 [changing = false]
16:08:17.415 [DEBUG] [org.gradle.api.internal.artifacts.repositories.resolver.DefaultExternalResourceArtifactResolver] Loading file:/var/local/android-sdk/extras/google/m2repository/androidx/room/room-runtime/2.0.0-rc01/room-runtime-2.0.0-rc01.pom
16:08:17.415 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.modulecache.DefaultModuleMetadataCache] Recording absence of module descriptor in cache: org.jetbrains.kotlin:kotlin-android-extensions-runtime:1.2.71 [changing = false]
16:08:17.415 [DEBUG] [org.gradle.api.internal.artifacts.repositories.resolver.DefaultExternalResourceArtifactResolver] Loading file:/var/local/android-sdk/extras/google/m2repository/org/jetbrains/kotlin/kotlin-stdlib-jdk7/1.2.71/kotlin-stdlib-jdk7-1.2.71.pom
16:08:17.415 [DEBUG] [org.gradle.api.internal.artifacts.repositories.resolver.DefaultExternalResourceArtifactResolver] Loading file:/var/local/android-sdk/extras/google/m2repository/org/jetbrains/kotlin/kotlin-android-extensions-runtime/1.2.71/kotlin-android-extensions-runtime-1.2.71.pom
16:08:17.416 [DEBUG] [org.gradle.api.internal.artifacts.repositories.resolver.DefaultExternalResourceArtifactResolver] Loading file:/var/local/android-sdk/extras/google/m2repository/org/jetbrains/kotlin/kotlin-stdlib-jdk7/1.2.71/kotlin-stdlib-jdk7-1.2.71.jar
16:08:17.416 [DEBUG] [org.gradle.api.internal.artifacts.repositories.resolver.DefaultExternalResourceArtifactResolver] Loading file:/var/local/android-sdk/extras/google/m2repository/org/jetbrains/kotlin/kotlin-android-extensions-runtime/1.2.71/kotlin-android-extensions-runtime-1.2.71.jar
16:08:17.415 [DEBUG] [org.gradle.api.internal.artifacts.repositories.resolver.DefaultExternalResourceArtifactResolver] Loading file:/var/local/android-sdk/extras/google/m2repository/androidx/room/room-runtime/2.0.0-rc01/room-runtime-2.0.0-rc01.jar
16:08:17.415 [DEBUG] [org.apache.http.impl.conn.PoolingHttpClientConnectionManager] Connection leased: [id: 28][route: {s}->https://dl.google.com:443][total kept alive: 0; route allocated: 1 of 20; total allocated: 1 of 20]
16:08:17.416 [DEBUG] [org.gradle.api.internal.artifacts.repositories.resolver.ExternalResourceResolver] No meta-data file or artifact found for module 'androidx.room:room-runtime:2.0.0-rc01' in repository '/var/local/android-sdk/extras/google/m2repository'.
16:08:17.416 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.modulecache.DefaultModuleMetadataCache] Recording absence of module descriptor in cache: androidx.room:room-runtime:2.0.0-rc01 [changing = false]
16:08:17.416 [DEBUG] [org.gradle.api.internal.artifacts.repositories.resolver.ExternalResourceResolver] No meta-data file or artifact found for module 'org.jetbrains.kotlin:kotlin-android-extensions-runtime:1.2.71' in repository '/var/local/android-sdk/extras/google/m2repository'.
16:08:17.416 [DEBUG] [org.gradle.api.internal.artifacts.repositories.resolver.ExternalResourceResolver] No meta-data file or artifact found for module 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.2.71' in repository '/var/local/android-sdk/extras/google/m2repository'.
16:08:17.416 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.modulecache.DefaultModuleMetadataCache] Recording absence of module descriptor in cache: org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.2.71 [changing = false]
16:08:17.416 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.modulecache.DefaultModuleMetadataCache] Recording absence of module descriptor in cache: org.jetbrains.kotlin:kotlin-android-extensions-runtime:1.2.71 [changing = false]
16:08:17.416 [DEBUG] [org.gradle.api.internal.artifacts.repositories.resolver.DefaultExternalResourceArtifactResolver] Loading file:/var/local/android-sdk/extras/android/m2repository/androidx/room/room-runtime/2.0.0-rc01/room-runtime-2.0.0-rc01.pom
16:08:17.416 [DEBUG] [org.apache.http.impl.execchain.MainClientExec] Opening connection {s}->https://dl.google.com:443
16:08:17.416 [DEBUG] [org.gradle.api.internal.artifacts.repositories.resolver.DefaultExternalResourceArtifactResolver] Loading file:/var/local/android-sdk/extras/android/m2repository/androidx/room/room-runtime/2.0.0-rc01/room-runtime-2.0.0-rc01.jar
16:08:17.416 [DEBUG] [org.gradle.api.internal.artifacts.repositories.resolver.DefaultExternalResourceArtifactResolver] Loading file:/var/local/android-sdk/extras/android/m2repository/org/jetbrains/kotlin/kotlin-android-extensions-runtime/1.2.71/kotlin-android-extensions-runtime-1.2.71.pom
16:08:17.416 [DEBUG] [org.gradle.api.internal.artifacts.repositories.resolver.DefaultExternalResourceArtifactResolver] Loading file:/var/local/android-sdk/extras/android/m2repository/org/jetbrains/kotlin/kotlin-stdlib-jdk7/1.2.71/kotlin-stdlib-jdk7-1.2.71.pom
16:08:17.416 [DEBUG] [org.gradle.api.internal.artifacts.repositories.resolver.DefaultExternalResourceArtifactResolver] Loading file:/var/local/android-sdk/extras/android/m2repository/org/jetbrains/kotlin/kotlin-android-extensions-runtime/1.2.71/kotlin-android-extensions-runtime-1.2.71.jar
16:08:17.416 [DEBUG] [org.gradle.api.internal.artifacts.repositories.resolver.ExternalResourceResolver] No meta-data file or artifact found for module 'androidx.room:room-runtime:2.0.0-rc01' in repository '/var/local/android-sdk/extras/android/m2repository'.
16:08:17.416 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.modulecache.DefaultModuleMetadataCache] Recording absence of module descriptor in cache: androidx.room:room-runtime:2.0.0-rc01 [changing = false]
16:08:17.416 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.ivyresolve.CachingModuleComponentRepository] Cached meta-data for module must be refreshed: will perform fresh resolve of 'androidx.room:room-runtime:2.0.0-rc01' in 'Google'
16:08:17.416 [DEBUG] [org.gradle.api.internal.artifacts.repositories.resolver.DefaultExternalResourceArtifactResolver] Loading https://dl.google.com/dl/android/maven2/androidx/room/room-runtime/2.0.0-rc01/room-runtime-2.0.0-rc01.pom
16:08:17.416 [DEBUG] [org.gradle.api.internal.artifacts.repositories.resolver.ExternalResourceResolver] No meta-data file or artifact found for module 'org.jetbrains.kotlin:kotlin-android-extensions-runtime:1.2.71' in repository '/var/local/android-sdk/extras/android/m2repository'.
16:08:17.416 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.modulecache.DefaultModuleMetadataCache] Recording absence of module descriptor in cache: org.jetbrains.kotlin:kotlin-android-extensions-runtime:1.2.71 [changing = false]
16:08:17.416 [DEBUG] [org.gradle.api.internal.artifacts.repositories.resolver.DefaultExternalResourceArtifactResolver] Loading file:/var/local/android-sdk/extras/android/m2repository/org/jetbrains/kotlin/kotlin-stdlib-jdk7/1.2.71/kotlin-stdlib-jdk7-1.2.71.jar
16:08:17.416 [DEBUG] [org.gradle.api.internal.artifacts.repositories.resolver.ExternalResourceResolver] No meta-data file or artifact found for module 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.2.71' in repository '/var/local/android-sdk/extras/android/m2repository'.
16:08:17.416 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.ivyresolve.CachingModuleComponentRepository] Cached meta-data for missing module is expired: will perform fresh resolve of 'org.jetbrains.kotlin:kotlin-android-extensions-runtime:1.2.71' in 'Google'
16:08:17.416 [DEBUG] [org.gradle.internal.resource.transfer.DefaultCacheAwareExternalResourceAccessor] Constructing external resource: https://dl.google.com/dl/android/maven2/androidx/room/room-runtime/2.0.0-rc01/room-runtime-2.0.0-rc01.pom
16:08:17.416 [DEBUG] [org.gradle.api.internal.artifacts.repositories.resolver.DefaultExternalResourceArtifactResolver] Loading https://dl.google.com/dl/android/maven2/org/jetbrains/kotlin/kotlin-android-extensions-runtime/1.2.71/kotlin-android-extensions-runtime-1.2.71.pom
16:08:17.416 [DEBUG] [org.gradle.internal.resource.transfer.DefaultCacheAwareExternalResourceAccessor] Constructing external resource: https://dl.google.com/dl/android/maven2/org/jetbrains/kotlin/kotlin-android-extensions-runtime/1.2.71/kotlin-android-extensions-runtime-1.2.71.pom
16:08:17.416 [DEBUG] [org.gradle.internal.progress.DefaultBuildOperationExecutor] Build operation 'Metadata of https://dl.google.com/dl/android/maven2/androidx/room/room-runtime/2.0.0-rc01/room-runtime-2.0.0-rc01.pom' started
16:08:17.416 [DEBUG] [org.gradle.internal.resource.transport.http.HttpResourceAccessor] Constructing external resource metadata: https://dl.google.com/dl/android/maven2/androidx/room/room-runtime/2.0.0-rc01/room-runtime-2.0.0-rc01.pom
16:08:17.416 [DEBUG] [org.gradle.internal.resource.transport.http.HttpClientHelper] Performing HTTP HEAD: https://dl.google.com/dl/android/maven2/androidx/room/room-runtime/2.0.0-rc01/room-runtime-2.0.0-rc01.pom
然后我尝试研究依赖项三,以了解谁可能带来它:
+--- org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.2.71
| \--- org.jetbrains.kotlin:kotlin-stdlib:1.2.71
| +--- org.jetbrains.kotlin:kotlin-stdlib-common:1.2.71
| \--- org.jetbrains:annotations:13.0
\--- android.arch.persistence.room:runtime:2.1.0-alpha02 -> androidx.room:room-runtime:2.0.0-rc01
+--- androidx.room:room-common:2.0.0-rc01
| \--- androidx.annotation:annotation:1.0.0-rc01
+--- androidx.sqlite:sqlite-framework:2.0.0-rc01
| +--- androidx.annotation:annotation:1.0.0-rc01
| \--- androidx.sqlite:sqlite:2.0.0-rc01
| \--- androidx.annotation:annotation:1.0.0-rc01
+--- androidx.sqlite:sqlite:2.0.0-rc01 (*)
+--- androidx.arch.core:core-runtime:2.0.0-rc01
| +--- androidx.annotation:annotation:1.0.0-rc01
| \--- androidx.arch.core:core-common:2.0.0-rc01
| \--- androidx.annotation:annotation:1.0.0-rc01
\--- androidx.legacy:legacy-support-core-utils:1.0.0-rc01
+--- androidx.annotation:annotation:1.0.0-rc01
+--- androidx.core:core:1.0.0-rc01
| +--- androidx.annotation:annotation:1.0.0-rc01
| +--- androidx.collection:collection:1.0.0-rc01
| | \--- androidx.annotation:annotation:1.0.0-rc01
| \--- androidx.versionedparcelable:versionedparcelable:1.0.0-rc01
| +--- androidx.annotation:annotation:1.0.0-rc01
| \--- androidx.collection:collection:1.0.0-rc01 (*)
+--- androidx.documentfile:documentfile:1.0.0-rc01
| \--- androidx.annotation:annotation:1.0.0-rc01
+--- androidx.loader:loader:1.0.0-rc01
| +--- androidx.annotation:annotation:1.0.0-rc01
| \--- androidx.core:core:1.0.0-rc01 (*)
+--- androidx.localbroadcastmanager:localbroadcastmanager:1.0.0-rc01
| \--- androidx.annotation:annotation:1.0.0-rc01
\--- androidx.print:print:1.0.0-rc01
\--- androidx.annotation:annotation:1.0.0-rc01
模块my-lib
仅包含会议室的依存关系,我不知道谁可能强制使用 2.0.0-rc01
我试图强制 2.1.0-alpha02 :
configurations.all {
resolutionStrategy {
force "android.arch.persistence.room:runtime:2.1.0-alpha02"
force "android.arch.persistence.room:compiler:2.1.0-alpha02"
}
}
但这对我没有帮助
我用清理缓存重新构建了很多次项目-这也没有帮助
我在项目中使用的存储库:
google()
jcenter()
mavenCentral()
androidx
有人遇到这样的事情吗?
答案 0 :(得分:-1)
我认为Room 2.1.0-alpha02版本仅在AndroidX API中可用。迁移到AndroidX,然后再尝试一次。