1

I applied to my project Android Architecture Components, by adding this lines to build.gradle:

// Android Architecture Lifecycle
compile "android.arch.lifecycle:runtime:1.0.0-alpha1"
compile "android.arch.lifecycle:extensions:1.0.0-alpha1"
annotationProcessor "android.arch.lifecycle:compiler:1.0.0-alpha1"

// Android Architecture Room
compile "android.arch.persistence.room:runtime:1.0.0-alpha1"
compile "android.arch.persistence.room:rxjava2:1.0.0-alpha1"
annotationProcessor "android.arch.persistence.room:compiler:1.0.0-alpha1"

It worked, but after updating Android Studio to Canary 3 version I'm still getting this error while compiling

Error:org.gradle.api.resources.ResourceException: Could not get resource 'https://jitpack.io/android/arch/lifecycle/runtime/1.0.0-alpha1/runtime-1.0.0-alpha1.pom'.

Error:org.gradle.api.UncheckedIOException: Could not HEAD 'https://jitpack.io/android/arch/lifecycle/runtime/1.0.0-alpha1/runtime-1.0.0-alpha1.pom'. Received status code 401 from server: Unauthorized

... other poms from library with the same error.

I tried restarting Android Studio, uninstalling app and of course clean-rebuild.

1 Answer 1

5

You need to add the new public Maven repo that Google is using to your build.gradle file.

For example, you could add it to the allprojects closure in the top-level build.gradle file:

allprojects {
    repositories {
        jcenter()
        maven { url 'https://maven.google.com' }
    }
}

Then, all of your modules (e.g., app/) will know to look there in addition to other places for the artifacts.

From your error message, it would appear that Android Studio is only looking in jitpack.io.

Sign up to request clarification or add additional context in comments.

1 Comment

Don't know why but I wasn't using jitpack.io so after removing this line, everything works. Also I had such configuration like you mentioned but with additional line.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.