Error:Execution failed for task ':app:compileDebugJavaWithJavac'. > android.databinding.tool.util.LoggedErrorException: Found data binding errors. ****/ data binding error ****msg:Cannot find the setter for attribute 'app:show_value' with parameter type int on com.yarui.app.client.ui.view.lcfengview.AddSubtractLinearLayout. file:E:\work_space\aa\app\src\main\res\layout\activity_plan_add_edit.xml loc:208:46 - 208:63 ****\ data binding error ****
當你遇到上述問題的時候,應更是你沒有設置set 屬性操作,例如下面:
@BindingAdapter({"show"})
public static void setText(View textView, String user) {
textView.setText(user);
}
--->請注意BindingAdapter括號裏面還有一個花括號呢,這個對應的就是你的佈局文件中的 app:show="hello" 屬性哦
參考:https://medium.com/androiddevelopers/android-data-binding-custom-setters-55a25a7aea47 解決報錯問題
https://blog.csdn.net/csc48656/article/details/73009398 解決報警問題