Trying to build a sample using Android Studio 3 Canary 5 with Architecture Components and Kotlin gives this warning.

Can anyone tell me the reason?

Thanks, Ove

编辑#1:

https://github.com/dlew/android-architecture-counter-sample

建筑格雷德尔:

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'

android {
    compileSdkVersion 25
    buildToolsVersion rootProject.ext.buildToolsVersion
    defaultConfig {
        applicationId "net.danlew.counter"
        minSdkVersion 23
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
    compile "com.android.support:recyclerview-v7:${rootProject.ext.supportLibVersion}"
    compile "com.android.support:design:${rootProject.ext.supportLibVersion}"
    compile "com.android.support:cardview-v7:${rootProject.ext.supportLibVersion}"
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    testCompile 'junit:junit:4.12'

    compile "android.arch.lifecycle:extensions:${rootProject.archLifecycleVersion}"
    compile "android.arch.persistence.room:runtime:${rootProject.archRoomVersion}"
    compile "android.arch.persistence.room:rxjava2:${rootProject.archRoomVersion}"
    kapt "android.arch.lifecycle:compiler:${rootProject.archLifecycleVersion}"
    kapt "android.arch.persistence.room:compiler:${rootProject.archRoomVersion}"
    compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"

    String butterKnifeVersion = '8.5.1'
    compile "com.jakewharton:butterknife:$butterKnifeVersion"
    kapt "com.jakewharton:butterknife-compiler:$butterKnifeVersion"

    compile 'io.reactivex.rxjava2:rxjava:2.1.0'

    String daggerVersion = '2.10'
    compile "com.google.dagger:dagger:$daggerVersion"
    kapt "com.google.dagger:dagger-compiler:$daggerVersion"

    String rxBindingVersion = '2.0.0'
    compile "com.jakewharton.rxbinding2:rxbinding:$rxBindingVersion"
    compile "com.jakewharton.rxbinding2:rxbinding-kotlin:$rxBindingVersion"

    compile 'com.jakewharton.timber:timber:4.5.1'

    compile 'com.jakewharton.rxrelay2:rxrelay:2.0.0'
}

repositories {
    mavenCentral()
}

推荐答案

现在有一个Java 8注释处理器,arch组件稳定,因此请更换:

"android.arch.lifecycle:compiler:${rootProject.archLifecycleVersion}"

with

"android.arch.lifecycle:common-java8:1.0.0"

Kotlin相关问答推荐

在kotlin中使用List(mylist. size){index—TODO()}或Map迭代>

用普通Kotlin理解Gradle的Kotlin DSL'""

在Mapstruct中重用@映射定义

在 Kotlin 中定义基于多态函数的泛型函数

Kotlin 说不需要强制转换,但删除后会出现新警告

为什么在jacksonObjectMapper上将DeserializationFeature.FAIL_ON_IGNORED_PROPERTIES设置为false无效?

在 detekt 配置文件中找不到某些属性

gradle 如何 Select 以-jvm结尾的库?

Kotlin 使用委托进行隐式覆盖

我什么时候可以在 LazyList 或 Column 的范围内使用 Composable?

使用 Kotlin 协程时 Room dao 类出错

如何创建 Kotlin DSL - DSL 语法 Kotlin

如何将 kotlin 集合作为 varagrs 传递?

RecyclerView SnapHelper无法显示第一个/最后一个元素

Kotlin使用运行时断言进行空判断?

在 Kotlin 函数上使用 Mokito anyObject() 时,指定为非 null 的参数为 null

安装 Kotlin-Jupyter:e: java.lang.NoClassDefFoundError: 无法初始化类 org.jetbrains.kotlin.com.intellij.pom.java.LanguageLevel

尾随 lambda 语法(Kotlin)的目的是什么?

Kotlin 的数据类 == C# 的 struct ?

是否可以在不使用class的情况下将 Mockito 与 Kotlin 一起使用?