Can't resolve Android databinding class

前端 未结 23 2249
南旧
南旧 2020-12-02 19:55

While using data binding , I am not able to get class MainActivityBinding as per Data Binding Guide

My layout name is activity_main.xml. I

23条回答
  •  情话喂你
    2020-12-02 20:33

    In my case DELETING the the app build folder and then rebuilding the project solved my problem.

    Even following steps did not work.

              1) Rebuild the project after adding the dataBinding  in gradle.
    
              2) Rebuild after adding layout tag in xml.
    
              3) cleaning the project
    
              4) rebuilding the project
    
              5) Restarted the Android Studio
    

    After enabling the dataBinding in app gradle file please rebuild. Then we can find Binding class generated.

              If the layout name is fragment_home, The Binding class name will be FragmentHomeBinding.
    

提交回复
热议问题