【DataBinding】Identifiers must have user defined types from the XML file. View is missing it

问题描述

报错:

e: [kapt] An exception occurred: android.databinding.tool.util.LoggedErrorException: Found data binding errors.
****/ data binding error ****msg:Identifiers must have user defined types from the XML file. View is missing it
file:D:\Android\MyApplication\***\***\***\app\src\main\res\layout\activity_***.xml
loc:28:60 - 28:63
loc:28:75 - 28:78
****\ data binding error ****

对应代码:

 

解决方案

参考:https://blog.csdn.net/qq_35599978/article/details/80093768

方式一:

其实这个bug很简单就是忘记在xml 中导入android.view.View包了,导入就好了

 代码:


                // 导入View包
    

 

你可能感兴趣的:(Android)