AndroidX迁移-数据绑定错误msg:找不到参数类型为int的属性"android:visibility"的设置器 [英] AndroidX migration - data binding error msg:Cannot find the setter for attribute 'android:visibility' with parameter type int
问题描述
我正在将项目迁移到AndroidX并出现以下错误:
I'm migrating a project to AndroidX and have the following error :
由以下原因引起:java.lang.RuntimeException:android.databinding.tool.util.LoggedErrorException:发现数据绑定错误.****/数据绑定错误**** msg:找不到参数类型为int的属性'android:visibility'的设置器androidx.constraintlayout.ConstraintLayout
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}">
我不知道该从哪里开始...非常感谢您的帮助
I don't know where to start ... Any help is greatly appreciated
推荐答案
尝试使用 androidx.constraintlayout.widget.ConstraintLayout
这篇关于AndroidX迁移-数据绑定错误msg:找不到参数类型为int的属性"android:visibility"的设置器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!