android jetpack 项目给出了 archlifecycleversion 构建错误 [英] android jetpack project gives archlifecycleversion build error

查看:22
本文介绍了android jetpack 项目给出了 archlifecycleversion 构建错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 android 开发的新手,刚刚按照本教程在 android studio 3.2 ( canary ) 中创建了我的第一个hello world"项目.https://developer.android.com/jetpack/docs/getting-started

I am new to android development and just created my first "hello world" project in android studio 3.2 ( canary ) following this tutorial. https://developer.android.com/jetpack/docs/getting-started

然后我只是做了 Build-> make project 项目试图构建并给我以下错误.

and then I just did Build- > make project project tried to build and gave me following error.

无法获取类型为 org.gradle.api.Project 的根项目JetpackHelloWorld"的未知属性archLifecycleVersion".

Could not get unknown property 'archLifecycleVersion' for root project 'JetpackHelloWorld' of type org.gradle.api.Project.

更新

依赖

以下是我的应用程序文件夹 build.gradle 文件中的依赖项标签

following is the dependencies tag in my app folder build.gradle file

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation"org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
    implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.android.support.constraint:constraint-layout:1.1.0'
    implementation 'android.arch.lifecycle:extensions:1.1.1'
    implementation "android.arch.lifecycle:extensions:$rootProject.archLifecycleVersion"
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}

推荐答案

用实际版本替换 $rootProject.archLifecycleVersion,我猜现在是 1.1.1

Replace $rootProject.archLifecycleVersion with actual version, i guess this is 1.1.1 right now

这篇关于android jetpack 项目给出了 archlifecycleversion 构建错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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