JP Ventura
JP Ventura

Reputation: 5732

Could not resolve org.kodein.di:kodein-di-framework-android

TL; DR

Access to Kodein core packages at JCenter are unauthorized.

Details

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

Answers (2)

Ganesh Garad
Ganesh Garad

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" }
    }
}

Visit for More Details

Upvotes: 1

JP Ventura
JP Ventura

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

Related Questions