android: data binding error: cannot find symbol class

后端 未结 26 2840
生来不讨喜
生来不讨喜 2020-12-14 05:49

I am getting started for using DataBinding feature. I am facing problem with it.

Error:(21, 9) error: cannot find symbol class ContactL

26条回答
  •  醉梦人生
    2020-12-14 05:58

    Actually it can be happend for various reason and for poor logging mechanism in data binding it is very hard to find the reason.So go got the proper error first go to the terminal and run the following command-

    gradlew :app:build --stacktrace
    

    It will show you the proper error with the number of line in XML where error is found.

    For example -

    ERROR: Could not find accessor com.example.model file://app\src\main\res\layout\fragment_example.xml Line:91
    

提交回复
热议问题