1. 程式人生 > >android.databinding.tool.util.LoggedErrorException: Found data binding errors

android.databinding.tool.util.LoggedErrorException: Found data binding errors

Execution failed for task ':app:compileDebugJavaWithJavac'.
> android.databinding.tool.util.LoggedErrorException: Found data binding errors.
  ****/ data binding error ****msg:Cannot find the getter for attribute 'android:text' with value type double on android.widget.TextView.
  file:E:\Project\AndroidStudioProjects\RetrofitLiveData\app\src\main\res\layout\fragment_event.xml
  loc:27:12 - 31:17
  ****\ data binding error ****

這是databinding在介面繫結的bean屬性格式和String型別不匹配所致,{}裡字串顯示就行

<TextView
                android:layout_width="30dp"
                android:layout_height="50dp"
                android:text="@={ `` +locationInfo.lat}"
                />