用于数据绑定
1)我添加了
android {
dataBinding {
enabled = true
}
到我的项目build.gradle
,但发生此错误:
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)然后我补充说:
apply plugin: "com.android.databinding"
(对项目build.gradle
)
和classpath "com.android.databinding:dataBinder:1.0-rc1"
(投影build.gradle
)
但是发生了同样的错误。