android - Realm 5.15.0 和最新版本 (6.0.2),gradle 同步失败
问题描述
我们使用 Realm 作为我们的 Android 数据库框架。当前的工作版本是 5.14.0。昨天我们尝试升级到 6.0.2 并且 gradle 同步失败。然后我推回版本,发现从 5.15.0 Realm 开始导致 gradle sync 失败并出现错误:
ERROR: Failed to resolve: io.realm:realm-android-library:5.15.0
ERROR: Failed to resolve: io.realm:realm-annotations:5.15.0
以及其他一些依赖项失败并出现相同的错误(但这些可能会受到第一次失败的影响)
当我再次尝试 5.14 版时,我没有收到任何错误,一切都很好。我检查了 gradle 构建日志,我可以看到这条线出现了很多次:
WARN - un.AndroidRunConfigurationBase - Can't get application ID: Android module missing
还有一些像这样的:
WARN - roid.tools.ndk.GradleWorkspace - NDK support for project 'project.name' is disabled because the project doesn't contain any valid native configurations.
还有一些:
INFO - ty.VersionCompatibilityChecker - Failed to find version reader for component 'android-gradle-experimental-plugin'
其中之一:
INFO - pl.ProjectRootManagerComponent - project roots have changed
最终:
INFO - e.project.sync.GradleSyncState - Gradle sync failed (50 s 766 ms)
看起来同步开始SYNC_TASK_CREATED
了,然后下载了一些库SETUP_STARTED
。然后它几乎立即失败。
有谁知道这里发生了什么以及可能失败的原因?我可以添加您可能需要的任何额外信息。
谢谢。
编辑: 我刚刚运行 ./gradlew check --stacktrace 以获取有关导致问题的更多信息,我得到了这个:
Could not determine the dependencies of task ':app-name:testProdReleaseUnitTest'.
> Could not resolve all task dependencies for configuration ':app-name:prodReleaseUnitTestRuntimeClasspath'.
> Could not find io.realm:realm-android-library:5.15.0.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/io/realm/realm-android-library/5.15.0/realm-android-library-5.15.0.pom
- https://dl.google.com/dl/android/maven2/io/realm/realm-android-library/5.15.0/realm-android-library-5.15.0.jar
- https://jitpack.io/io/realm/realm-android-library/5.15.0/realm-android-library-5.15.0.pom
- https://jitpack.io/io/realm/realm-android-library/5.15.0/realm-android-library-5.15.0.jar
- https://maven.fabric.io/public/io/realm/realm-android-library/5.15.0/realm-android-library-5.15.0.pom
- https://maven.fabric.io/public/io/realm/realm-android-library/5.15.0/realm-android-library-5.15.0.jar
- https://github.com/uPhyca/stetho-realm/raw/master/maven-repo/io/realm/realm-android-library/5.15.0/realm-android-library-5.15.0.pom
- https://github.com/uPhyca/stetho-realm/raw/master/maven-repo/io/realm/realm-android-library/5.15.0/realm-android-library-5.15.0.jar
- http://maven.batch.com/release/io/realm/realm-android-library/5.15.0/realm-android-library-5.15.0.pom
- http://maven.batch.com/release/io/realm/realm-android-library/5.15.0/realm-android-library-5.15.0.jar
- https://repo.maven.apache.org/maven2/io/realm/realm-android-library/5.15.0/realm-android-library-5.15.0.pom
- https://repo.maven.apache.org/maven2/io/realm/realm-android-library/5.15.0/realm-android-library-5.15.0.jar
Caused by: org.gradle.internal.resolve.ModuleVersionNotFoundException: Could not find io.realm:realm-android-library:5.15.0.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/io/realm/realm-android-library/5.15.0/realm-android-library-5.15.0.pom
- https://dl.google.com/dl/android/maven2/io/realm/realm-android-library/5.15.0/realm-android-library-5.15.0.jar
- https://jitpack.io/io/realm/realm-android-library/5.15.0/realm-android-library-5.15.0.pom
- https://jitpack.io/io/realm/realm-android-library/5.15.0/realm-android-library-5.15.0.jar
- https://maven.fabric.io/public/io/realm/realm-android-library/5.15.0/realm-android-library-5.15.0.pom
- https://maven.fabric.io/public/io/realm/realm-android-library/5.15.0/realm-android-library-5.15.0.jar
- https://github.com/uPhyca/stetho-realm/raw/master/maven-repo/io/realm/realm-android-library/5.15.0/realm-android-library-5.15.0.pom
- https://github.com/uPhyca/stetho-realm/raw/master/maven-repo/io/realm/realm-android-library/5.15.0/realm-android-library-5.15.0.jar
- http://maven.batch.com/release/io/realm/realm-android-library/5.15.0/realm-android-library-5.15.0.pom
- http://maven.batch.com/release/io/realm/realm-android-library/5.15.0/realm-android-library-5.15.0.jar
- https://repo.maven.apache.org/maven2/io/realm/realm-android-library/5.15.0/realm-android-library-5.15.0.pom
- https://repo.maven.apache.org/maven2/io/realm/realm-android-library/5.15.0/realm-android-library-5.15.0.jar
解决方案
好吧,那很愚蠢。我真的应该给错误信息更多的信任......
我添加了
mavenLocal()
jcenter()
至
allprojects {
repositories {
}
在根 build.gradle 文件中,现在它找到了 Realm repo。呵呵。感谢这个问题的所有观众。
推荐阅读
- scala - 在 Scala 中,理解的产出是如何工作的?
- macos - 有关更多详细信息,请参阅:'go help gopath'
- swift - 未找到“FBSDKCoreKit/FBSDKAppLink.h”文件
- php - Laravel 将输入作为具有不同键的数组发布未验证
- java - 如何防止单击 NonScrollableViewPager 中的其他选项卡?
- ionic3 - 我在移动应用程序中使用 ionic3 和 angular4,我对 ion-datetime 有疑问,我的要求是仅显示当前日期和未来 15 天
- ios - UICollectionView 拖放移除半透明单元格
- javascript - Redux saga 执行多个 HTTP 请求
- ios - 使用webview制作IOS应用时输入类型错误
- javascript - 删除 `package-lock.json` 以快速解决冲突