Search code examples
androidandroid-constraintlayoutruntimeexceptionandroidx

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


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


Solution

  • Try using androidx.constraintlayout.widget.ConstraintLayout