I'm working on a big project and I'm trying to add view binding using two different aproaches:
buildFeatures {
viewBinding true
}
viewBinding {
enabled true
}
On both cases I get a Caused by: groovy.lang.MissingMethodException: No signature of method: build_4xgux05b5phesnrai6p6fg7vc.android() is applicable for argument types: (build_4xgux05b5phesnrai6p6fg7vc$_run_closure3) values: [build_4xgux05b5phesnrai6p6fg7vc$_run_closure3@5e534db6]
I am putting this inside android { }
on my module:app.
Any idea why this might be happening?
You need to increase android gradle plugin version to 3.6.0 (or higher):
// Android Gradle Plugin 3.6.0
android {
viewBinding {
enabled = true
}
}
Or:
// Android Gradle Plugin 4.0
android {
buildFeatures {
viewBinding = true
}
}