hello. does any1 know the name of the gradle task to run when generating the viewbinding classes ?
a
Adrien
02/04/2021, 1:49 PM
dataBindingGenBaseClasses
?
d
D Tam
02/04/2021, 1:52 PM
In Android IDE 4.x onwards, I add the following in the app build.gradle file :
Copy code
buildFeatures {
viewBinding true
}
D Tam
02/04/2021, 1:52 PM
This automatically generates your XML resource file when you create a new class.
a
Adrien
02/04/2021, 1:54 PM
@D Tam Yes but sometimes Android Studio displays every viewbinding classes in red and refuse to generate them. Running the gradle task may help to fix the issue
m
myanmarking
02/04/2021, 1:54 PM
yes i know. but sometimes IDE bugs or whatever. and the binding class not generated. Instead of having to invalida cache, i just rerun the gradle task