For databinding
1) I have added
android {
    dataBinding {
        enabled = true
    }
to my project build.gradle, but this error occurs:  
Error:(5, 0) Gradle DSL method not found: 'dataBinding()'
Possible causes:
.The project 'exampleDatabinding' may be using a version of Gradle that does    
not contain the method.
Gradle settings
.The build file may be missing a Gradle plugin.
Apply Gradle plugin
2) Then I added:
apply plugin: "com.android.databinding" (to project build.gradle)
and classpath "com.android.databinding:dataBinder:1.0-rc1"  (to project build.gradle)
But the same error occured.
In the file build.gradle of the project add the dependency
dependencies {
        classpath 'com.android.tools.build:gradle:1.5.0-beta2'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
And in the file build.gradle of the module include the dataBinding section:
android{
  ...
  dataBinding {
        enabled = true
    }
  ...
}
The versions of build.gradle can be found here: Versions
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With