Error using databinding in android

后端 未结 12 875
情深已故
情深已故 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:06

    According to the current version of the guide (2015-11-11) you just have to add two dependencies: In the file build.gradle of the project add the gradle dependency. Currently the most recent version is 1.5.0-beta3

    dependencies {
            classpath 'com.android.tools.build:gradle:1.5.0-beta3'
        }
    

    And in the file build.gradle of the module include the dataBinding section:

    android{
      ...
      dataBinding {
            enabled = true
        }
      ...
    }
    

    The error

    error: package my.package.name.databinding does not exists

    may ocurr because a mismatch between the xml and the POJO class

提交回复
热议问题