AndroidX 迁移 - 数据绑定错误 msg:Cannot 找到参数类型为 int 的属性 'android:visibility' 的 setter
AndroidX migration - data binding error msg:Cannot find the setter for attribute 'android:visibility' with parameter type int
我正在将项目迁移到 AndroidX 并出现以下错误:
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
有问题的布局是:
<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}">
我不知道从哪里开始...非常感谢任何帮助
尝试使用 androidx.constraintlayout.widget.ConstraintLayout
我正在将项目迁移到 AndroidX 并出现以下错误:
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
有问题的布局是:
<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}">
我不知道从哪里开始...非常感谢任何帮助
尝试使用 androidx.constraintlayout.widget.ConstraintLayout