Reputation: 5732
Access to Kodein core packages at JCenter are unauthorized.
We are using Kodein for dependency injection, but suddenly JCenter server is returning Unauthorized
when Gradle tries to download any org.kodein.*
artifact.
* 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
It also has being reported as an issue by Kodein-DI community.
Is it possible to obtain the artifacts from another server?
Upvotes: 2
Views: 1567
Reputation: 391
Add below code in your project level build.gradle file and sync project:
allprojects {
repositories {
google()
jcenter()
maven {url "https://jitpack.io"}
maven { url "https://dl.bintray.com/kodein-framework/Kodein-DI" }
}
}
Upvotes: 1
Reputation: 5732
While access to JCenter is not reestablished, this quick hacked allowed to compile the project:
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' }
}
}
Basically it ignores Kodein artifacts from JitPack and downloads them from Bintray instead
Upvotes: 3