简体   繁体   English

AndroidX迁移-数据绑定错误msg:找不到参数类型为int的属性“ android:visibility”的设置器

[英]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 : 我正在将项目迁移到AndroidX并出现以下错误:

Caused by: java.lang.RuntimeException: android.databinding.tool.util.LoggedErrorException: Found data binding errors. 造成原因:java.lang.RuntimeException:android.databinding.tool.util.LoggedErrorException:发现了数据绑定错误。 ****/ data binding error ****msg:Cannot find the setter for attribute 'android:visibility' with parameter type int on androidx.constraintlayout.ConstraintLayout **** /数据绑定错误**** msg:在androidx.constraintlayout.ConstraintLayout上找不到参数类型为int的属性“ android:visibility”的设置器

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 我不知道从哪里开始。非常感谢您的帮助。

尝试使用androidx.constraintlayout.widget.ConstraintLayout

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 ****/ 数据绑定错误 ****msg:在 android.widget.ImageView 上找不到参数类型为 java.lang.String 的属性“app:image_url”的设置器 - ****/ data binding error ****msg:Cannot find the setter for attribute 'app:image_url' with parameter type java.lang.String on android.widget.ImageView 找不到参数类型为int的属性“ android:textColorHint”的设置器 - Cannot find the setter for attribute 'android:textColorHint' with parameter type int 添加 buildFeatures { viewBinding true } 会导致“无法为 <... android:visibility> 找到接受参数类型 'int' 的 setter - Adding buildFeatures { viewBinding true } results in "Cannot find a setter for <... android:visibility> that accepts parameter type 'int' 在 android.widget.ImageView 上找不到参数类型为 int 的属性“android:layout_width”的设置器 - Cannot find the setter for attribute 'android:layout_width' with parameter type int on android.widget.ImageView 在 androidx.recyclerview.widget.RecyclerView 上找不到参数类型为 boolean 的属性“app:fastScrollEnabled”的设置器 - Cannot find the setter for attribute 'app:fastScrollEnabled' with parameter type boolean on androidx.recyclerview.widget.RecyclerView msg:在数据绑定中找不到值为java.lang.String的属性&#39;android:text&#39;的getter? - msg:Cannot find the getter for attribute 'android:text' with value type java.lang.String in data binding? Android数据绑定:找不到属性app:list的setter - Android data binding : Cannot find setter for attribute app:list 在数据绑定中找不到属性的设置器 - Cannot find the setter for attribute in Data binding Android数据绑定BindingAdapter:“找不到设置器” - Android Data Binding BindingAdapter: “Cannot find the setter” 找不到吸气剂<progressbar android:visibility>接受参数类型'androidx.databinding.ObservableField<java.lang.boolean> '</java.lang.boolean></progressbar> - Cannot find a getter for <ProgressBar android:visibility> that accepts parameter type 'androidx.databinding.ObservableField<java.lang.Boolean>'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM