无法解决:android.arch.lifecycle:extensions:1.0.0-alpha1 android studio 3.0 [英] Failed to resolve: android.arch.lifecycle:extensions:1.0.0-alpha1 android studio 3.0

查看:60
本文介绍了无法解决:android.arch.lifecycle:extensions:1.0.0-alpha1 android studio 3.0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用android插件'com.android.tools.build:gradle:3.0.0-alpha1'和gradle版本 gradle-4.0-milestone在android studio 3.0中构建项目-1-all.zip .

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.

也使用了Maven仓库:

Used maven repo as well:

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

此外,在我的项目中使用android Room的持久性和生命周期.已经在我的应用gradle文件中声明了以下依赖项:

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:

无法解决:android.arch.lifecycle:extensions:1.0.0-alpha1

我是否缺少此问题的解决方案或其他解决方案.

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

推荐答案

我已通过更新应用程序 build.gradle 文件来解决此问题,如下所示:

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
}

实际上,

实际上必须从 buildscript 存储库中删除Maven存储库,并添加到 allprojects 存储库中,如上所示.另外,您可以在两个地方都保留Maven存储库,但必须将其包含在 allprojects 存储库中以解决此问题.

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.

这篇关于无法解决:android.arch.lifecycle:extensions:1.0.0-alpha1 android studio 3.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆