其他分享
首页 > 其他分享> > android jetpack项目给出了archlifecycleversion构建错误

android jetpack项目给出了archlifecycleversion构建错误

作者:互联网

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

然后我就做了Build-> make project project试图建立并给我以下错误.

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

UPDATE

依赖

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

标签:android,android-jetpack,android-studio,kotlin
来源: https://codeday.me/bug/20190731/1587305.html