How to use Data Binding and Kotlin in Android Studio 3.0.0

后端 未结 4 1884
庸人自扰
庸人自扰 2020-11-29 22:40

I just started to use Android Studio 3.0.0, but every time I try to build my project I get this error:

Error:Circular dependency between the following tasks:         


        
4条回答
  •  猫巷女王i
    2020-11-29 23:27

    I have recenly write Blog for Data Binding android with Kotlin here

    Use Classpath

    classpath 'com.android.tools.build:gradle:3.0.0-beta2'
    

    Dependency

    apply plugin: 'kotlin-android'
    
    apply plugin: 'kotlin-android-extensions'
    
    apply plugin: 'kotlin-kapt'
    
    android {
        ...
        dataBinding {
            enabled = true
        }
    }
    
    dependencies {
        ......
        kapt 'com.android.databinding:compiler:2.3.1'
    }
    

    for more detail check out this post

提交回复
热议问题