问题
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