2019-11-07

一次粗心大意的记录,大家引以为戒。

Error:Execution failed for task ':compileDebugJavaWithJavac'.

> 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:\AKE\workspace\NB_BToI\src\main\res\layout\activity_device_new.xml

  loc:112:65 - 112:68

  loc:112:77 - 112:80

  ****\ data binding error ****

xml中代码如下

 

    android:id="@+id/ll_fold"

    android:layout_width="match_parent"

    android:layout_height="match_parent"

    android:layout_gravity="center_horizontal|start"

    android:gravity="center_vertical"

    android:orientation="horizontal"

    android:visibility="@{scanbean.isHidExpend ? View.GONE : View.VISIBLE}">

其实明明知道是visibility这行代码出问题了,可就是不知道是啥问题。找了很多资料才发现 

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

————————————————

版权声明:本文为CSDN博主「王瑜的csdn」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。

原文链接:https://blog.csdn.net/qq_35599978/article/details/80093768

你可能感兴趣的:(2019-11-07)