Error using databinding in android

后端 未结 12 914
情深已故
情深已故 2020-12-16 09:45

I am trying to test data binding as given in the guide here. I have included this in my build.gradle file (of module app) :

compileSdkVersion \'android-MNC\         


        
12条回答
  •  难免孤独
    2020-12-16 10:28

    If you are using 'android-apt' plugin for dagger or other libraries, after enabling data binding, you have to remove 'android-apt' plugin and use 'provided' instead of 'apt' in your dependencies. For example if you are using dagger, remove this

    classpath 'com.neenbedankt.gradle.plugins:android-apt:1.4'
    

    and this

    apply plugin: 'com.neenbedankt.android-apt' 
    

    and then replace

    apt 'com.google.dagger:dagger-compiler:2.0'
    

    with

    provided 'com.google.dagger:dagger-compiler:2.0'
    

提交回复
热议问题