2

我收到错误 Kotlin kapt 3rd-party Gradle 插件可能是原因。我为 kotlin-kapt 添加了插件,并使用 android.databindingV3=true 更新了我的 gradle 属性。但我仍然收到错误的第 3 部分 Gradle 插件。如何解决这个问题?

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


    android {
       ...
        dataBinding {
            enabled = true
        }

    }

    dependencies {
        implementation fileTree(dir: 'libs', include: ['*.jar'])
        implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
        implementation 'com.android.support:appcompat-v7:28.0.0'
        implementation 'com.android.support.constraint:constraint-layout:1.1.3'
        implementation 'com.android.support:recyclerview-v7:28.0.0'

        //Room
        implementation "android.arch.persistence.room:runtime:1.1.1"
        kapt "android.arch.persistence.room:compiler:1.1.1"

        ///Lifecycles, LiveData and ViewModel
        kapt 'com.android.databinding:compiler:3.1.4'

        // ViewModel and LiveData
        implementation "android.arch.lifecycle:extensions:1.1.1"

        // ViewModel
        implementation "android.arch.lifecycle:viewmodel:1.1.1"

        // LiveData
        implementation "android.arch.lifecycle:livedata:1.1.1"
        kapt "android.arch.lifecycle:compiler:1.1.1"

        annotationProcessor "android.arch.persistence.room:compiler:1.1.1"
        androidTestImplementation "android.arch.persistence.room:testing:1.1.1"
        androidTestImplementation "android.arch.core:core-testing:1.1.1"
        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'
    }
4

0 回答 0