gpt4 book ai didi

android - 无法解析 org.kodein.di :kodein-di-framework-android

转载 作者:搜寻专家 更新时间:2023-11-01 09:20:41 27 4
gpt4 key购买 nike

TL;博士

在 JCenter 访问 Kodein 核心包是未经授权的。

详情

我们正在使用 Kodein 进行依赖注入(inject),但是当 Gradle 尝试下载任何 org.kodein.* Artifact 时,JCenter 服务器突然返回 Unauthorized

* What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> Could not resolve all task dependencies for configuration ':app:debugCompileClasspath'.
> Could not resolve org.kodein.di:kodein-di-framework-android-x:6.1.0.
Required by:
project :app
> Could not resolve org.kodein.di:kodein-di-framework-android-x:6.1.0.
> Could not get resource 'https://jitpack.io/org/kodein/di/kodein-di-framework-android-x/6.1.0/kodein-di-framework-android-x-6.1.0.pom'.
> Could not HEAD 'https://jitpack.io/org/kodein/di/kodein-di-framework-android-x/6.1.0/kodein-di-framework-android-x-6.1.0.pom'.
Received status code 401 from server: Unauthorized
> Could not resolve org.kodein.di:kodein-di-generic-jvm:6.1.0.
Required by:
project :app
> Could not resolve org.kodein.di:kodein-di-generic-jvm:6.1.0.
> Could not get resource 'https://jitpack.io/org/kodein/di/kodein-di-generic-jvm/6.1.0/kodein-di-generic-jvm-6.1.0.pom'.
> Could not HEAD 'https://jitpack.io/org/kodein/di/kodein-di-generic-jvm/6.1.0/kodein-di-generic-jvm-6.1.0.pom'.
Received status code 401 from server: Unauthorized

它也被报告为 issue by Kodein-DI community .

是否可以从其他服务器获取 Artifact ?

最佳答案

虽然没有重新建立对 JCenter 的访问,但这种快速破解允许编译项目:

allprojects {
repositories {
google()
jcenter()
maven {
url 'http://dl.bintray.com/kotlin/kotlin-eap'
content {
includeGroup "org.kodein"
}
}
maven { url 'https://jitpack.io' }
maven { url 'https://dl.bintray.com/kodein-framework/Kodein-DI' }
}
}

基本上它会忽略来自 JitPack 的 Kodein Artifact ,而是从 Bintray 下载它们

关于android - 无法解析 org.kodein.di :kodein-di-framework-android,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56037232/

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