[Solved] Awesome databinding error solution: Could not find the class file of androidx.databinding.DataBindingComponent

This problem is caused by relying on the model. ViewBinding and dataBinding have been turned on in basemodel, but this error occurs when dataBinding is not turned on in app project

You need to check whether all models using viewBinding and dataBinding in your project have the corresponding dependencies enabled. If the model used is not enabled, an error will be reported.

In my project, viewBinding and dataBinding configurations are enabled in basemodel

But the configuration in the app project is missing the configuration of the dataBinding

Solution: All models using viewBinding and dataBinding need to be enabled, otherwise the system cannot find the corresponding guide package

 viewBinding {
        enabled = true
    }
    dataBinding {
        enabled = true
    }

Depending on your own needs, using the viewBinding function alone uses the dependencies of viewBinding. If you need to use dataBinding, use the dependencies of dataBinding. The project can use viewBinding and dataBinding at the same time.

Use dataBinding for functions with more data interaction, otherwise you can use viewBinding, dataBinding is too heavy and cumbersome to use