The build.gradle script (module) structure is:
plugin {
...
id 'org.jetbrains.kotlin.kapt'
}
android {
...
buildTypes {
...
}
dataBinding {
enabled = true
}
}
If I try to sync my project I get:
Could not set unknown property 'enabled' for BuildType_Decorated{name=dataBinding}
And when I hover in bold enable = true instruction from dataBinding block:
If you plan to use data binding in a Kotlin project, you should apply the kotlin-kapt plugin
Why is that happening if I included the plugin above? Both AS and Kotlin plugins are up to date… Is there any difference between ‘kotlin-kapt’ and ‘org.jetbrains.kotlin.kapt’?
2
Answers
Data binding in
build.gradle
should be like this:Source
However it is not important to use that plugin to use data bind just do
android { dataBinding { enabled = true}
Inside the android brackets
Clean the project and then do sync