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

后端 未结 7 1587
无人及你
无人及你 2021-02-05 02:09

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-al

相关标签:
7条回答
  • 2021-02-05 02:35

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

    0 讨论(0)
  • 2021-02-05 02:35

    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

    0 讨论(0)
  • 2021-02-05 02:36

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

    0 讨论(0)
  • 2021-02-05 02:38

    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.

    0 讨论(0)
  • 2021-02-05 02:41

    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

    0 讨论(0)
  • 2021-02-05 02:44

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

    0 讨论(0)
提交回复
热议问题