hello. does any1 know the name of the gradle task ...
# android
m
hello. does any1 know the name of the gradle task to run when generating the viewbinding classes ?
a
dataBindingGenBaseClasses
?
d
In Android IDE 4.x onwards, I add the following in the app build.gradle file :
Copy code
buildFeatures {
        viewBinding true
    }
This automatically generates your XML resource file when you create a new class.
a
@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
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
thanks
yaya, thanks