gpt4 book ai didi

android - Realm 5.15.0 及最新版本 (6.0.2),gradle sync 失败

转载 作者:行者123 更新时间:2023-11-30 04:56:03 43 4
gpt4 key购买 nike

我们使用 Realm 作为 Android 的数据库框架。当前工作版本是 5.14.0。昨天我们尝试升级到 6.0.2,但 gradle sync 失败了。然后我推回版本并看到从 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 仓库。呵呵。感谢所有看本题的人。

关于android - Realm 5.15.0 及最新版本 (6.0.2),gradle sync 失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59136469/

43 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com