DSL element 'android.viewBinding.enabled' is obsolete and has been replaced with 'android.buildFeatures.viewBinding'.
It will be removed in version 5.0 of the Android Gradle plugin.
Affected Modules: app
我的Android studio版本如下: Bumblebee | 2021.1.1 Patch 2
实际上就是换一种写法。错误信息也给了解决办法。
原来这样:
android {
dataBinding {
enabled = true
}
viewBinding {
enabled = true
}
}
现在是:
android {
buildFeatures{
dataBinding = true
viewBinding = true
}
}