无法解析android.arch.lifecycle:extensions:1.1.0

编程入门 行业动态 更新时间:2024-10-26 07:34:38
本文介绍了无法解析android.arch.lifecycle:extensions:1.1.0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在尝试将lifecycle:extensions添加到我的项目中,但是我无法使其正常工作.每次显示错误.

I am trying to add lifecycle:extensions to my project but i can not make it work . Each time it shows error .

无法解析':app @ debug/compileClasspath'的依赖关系:无法解析android.arch.lifecycle:extensions:1.1.0.

Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve android.arch.lifecycle:extensions:1.1.0.

我已经阅读了多个线程,但无法通过此处给出的答案使其正常工作. 项目级别的收益是:

I have already read several threads but could not make it work by the answers given there. Project level gradle is:

buildscript { repositories { google() jcenter() } dependencies { classpath 'com.android.tools.build:gradle:3.1.2' } } allprojects { repositories { google() maven { url 'maven.google' } jcenter() mavenCentral() flatDir { dirs 'libs' } } } task clean(type: Delete) { delete rootProject.buildDir }

build.gradle是:

And build.gradle is :

implementation "android.arch.lifecycle:extensions:1.1.0" annotationProcessor "android.arch.lifecycle:compiler:1.1.0"

我如何使其起作用?我在Android Studio 3.1.2上.我也尝试导入一些github示例,但是每次都发生相同的错误.现在已经7个小时了,我一直在努力解决这个问题.

How can i make it work? I am on Android Studio 3.1.2 . I also tried to import some github samples but same error occurred each time . Now its been 7 hours i have been busting my head on this.

推荐答案

您已经添加了Build.gradle中的nofollow noreferrer> google() ,因此,请尝试添加最新版本:

You already added google() in the Build.gradle so, try adding the latest version:

implementation "android.arch.lifecycle:extensions:1.1.1" annotationProcessor "android.arch.lifecycle:compiler:1.1.1"

另外,请转到:

File -> Settings -> Build, Execution, Deployment -> Build tools -> Gradle

如果已选择从存储库下载,请取消选中该选项.

And uncheck the option if it is checked to download from repository.

如果没有帮助,将gradle更新到最新版本将有所帮助:

In case it didn't help, updating gradle to the latest version will help:

dependencies { classpath 'com.android.tools.build:gradle:3.1.4' }

更多推荐

无法解析android.arch.lifecycle:extensions:1.1.0

本文发布于:2023-11-15 04:11:44,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1591031.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:arch   android   lifecycle   extensions

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!