AndroidX migration - data binding error msg:Cannot find the setter for attribute 'android:visibility' with parameter type int

醉酒当歌 提交于 2021-02-20 04:42:45

问题


I'm migrating a project to AndroidX and have the following error :

Caused by: java.lang.RuntimeException: android.databinding.tool.util.LoggedErrorException: Found data binding errors. ****/ data binding error ****msg:Cannot find the setter for attribute 'android:visibility' with parameter type int on androidx.constraintlayout.ConstraintLayout

And the layout having the issue is :

<androidx.constraintlayout.ConstraintLayout
  android:layout_width="match_parent"
  android:layout_height="wrap_content"
  android:layout_centerInParent="true"
  android:visibility="@{myVar == STRING_SUCCESS ? View.GONE : View.VISIBLE}">

I don't know where to start ... Any help is greatly appreciated


回答1:


Try using androidx.constraintlayout.widget.ConstraintLayout



来源:https://stackoverflow.com/questions/55571737/androidx-migration-data-binding-error-msgcannot-find-the-setter-for-attribute

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!