0xAliHn
0xAliHn

Reputation: 19240

Failed to resolve: android.arch.lifecycle:extensions:1.0.0-alpha1 android studio 3.0

I am building a project in android studio 3.0 with android plugin 'com.android.tools.build:gradle:3.0.0-alpha1' and gradle version gradle-4.0-milestone-1-all.zip.

Used maven repo as well:

maven {
            url 'https://maven.google.com'
      }

Also, Using android Room persistence and lifecycle in my project. Already declared below dependencies in my app gradle file:

compile "android.arch.lifecycle:extensions:1.0.0-alpha1"
compile "android.arch.persistence.room:runtime:1.0.0-alpha1"
annotationProcessor "android.arch.lifecycle:compiler:1.0.0-alpha1"
annotationProcessor "android.arch.persistence.room:compiler:1.0.0-alpha1"

When Sync and build the project it's showing below error:

Failed to resolve: android.arch.lifecycle:extensions:1.0.0-alpha1

Am I missing something or any other solution for this issue.

Upvotes: 32

Views: 34975

Answers (7)

Thrwat Zidan
Thrwat Zidan

Reputation: 31

am find solution work with me Room Dependencies for Room, including testing Room migrations and Room RxJava

dependencies {
    def room_version = "1.1.1"

    implementation "android.arch.persistence.room:runtime:$room_version"
    annotationProcessor "android.arch.persistence.room:compiler:$room_version" // use kapt for Kotlin

    // optional - RxJava support for Room
    implementation "android.arch.persistence.room:rxjava2:$room_version"

    // optional - Guava support for Room, including Optional and ListenableFuture
    implementation "android.arch.persistence.room:guava:$room_version"

    // Test helpers
    testImplementation "android.arch.persistence.room:testing:$room_version"
}

as the document says: https://developer.android.com/topic/libraries/architecture/adding-components

Upvotes: 3

rakesh rajput
rakesh rajput

Reputation: 626

open preference for mac or you can open setting for windows then search proxy setting inside the open window then unchecked proxy authentication it will work

Upvotes: 0

Omar Alnajjar
Omar Alnajjar

Reputation: 447

Just add maven { url 'https://maven.google.com' } to your project gradle

Upvotes: 1

You require latest gradle version 'com.android.tools.build:gradle:3.0.0-alpha2' and Studio Version 3.0+ to use Room

Upvotes: 1

saksham
saksham

Reputation: 3324

Add in app/gradle file

compile "android.arch.lifecycle:extensions:1.0.0-alpha4"
compile "android.arch.persistence.room:runtime:1.0.0-alpha4"
annotationProcessor "android.arch.lifecycle:compiler:1.0.0-alpha4"
annotationProcessor "android.arch.persistence.room:compiler:1.0.0-alpha4"

add maven to project based gradle

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

it will compile easily

Upvotes: 7

粟成建
粟成建

Reputation: 21

you can change "https://maven.google.com" to "https://dl.google.com/dl/android/maven2/" to solve the problem.

Upvotes: 2

0xAliHn
0xAliHn

Reputation: 19240

I have fixed the issue by updating my app build.gradle file like below:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.0-alpha2'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

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

task clean(type: Delete) {
    delete rootProject.buildDir
}

Actually had to remove the maven repository from buildscript repositories and added to allprojects repositories as shown above. Also you can keep the maven repository at both places but must include in allprojects repositories to fix the issue.

Upvotes: 30

Related Questions