一次粗心大意的記錄薯鳍,大家引以為戒沦偎。
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中代碼如下
? <LinearLayout
? ? 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}">
其實(shí)明明知道是visibility這行代碼出問(wèn)題了,可就是不知道是啥問(wèn)題署隘。找了很多資料才發(fā)現(xiàn)?
其實(shí)這個(gè)bug很簡(jiǎn)單就是忘記在xml 中導(dǎo)入android.view.View包了,導(dǎo)入就好了
————————————————
版權(quán)聲明:本文為CSDN博主「王瑜的csdn」的原創(chuàng)文章,遵循 CC 4.0 BY-SA 版權(quán)協(xié)議况鸣,轉(zhuǎn)載請(qǐng)附上原文出處鏈接及本聲明。
原文鏈接:https://blog.csdn.net/qq_35599978/article/details/80093768