Android 在布局内使用MutableLiveData变量[Gradle to 3.5.1]时,数据绑定停止工作

Android 在布局内使用MutableLiveData变量[Gradle to 3.5.1]时,数据绑定停止工作,android,gradle,android-databinding,generated-code,Android,Gradle,Android Databinding,Generated Code,我正在我的项目中使用数据绑定。使用Java,而不是Kotlin,Android Studio版本是3.5.1(最新版本) 将project gradle版本从3.5.0升级到3.5.1后,在*BindingImpl类中出现错误。 我发现问题在于我的一个布局文件中的可变LiveData 试图清理项目并重新启动Android Studio。但唯一有效的办法是将gradle版本推迟到3.5.0 这是我的布局 <?xml version="1.0" encoding="utf-8"?> &l

我正在我的项目中使用数据绑定。使用Java,而不是Kotlin,Android Studio版本是3.5.1(最新版本)

将project gradle版本从3.5.0升级到3.5.1后,在*BindingImpl类中出现错误。 我发现问题在于我的一个布局文件中的可变LiveData

试图清理项目并重新启动Android Studio。但唯一有效的办法是将gradle版本推迟到3.5.0

这是我的布局

<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools">

    <data>

        <import type="androidx.lifecycle.MutableLiveData" />

        <variable
            name="hintText"
            type="String" />

        <variable
            name="helperText"
            type="String" />

        <variable
            name="collection"
            type="Object" />

        <variable
            name="selection"
            type="MutableLiveData" /> // this one is breaks down in 3.5.1

        <variable
            name="enabled"
            type="Boolean" />

    </data>

    <androidx.constraintlayout.widget.ConstraintLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:setupSpinnerHint="@{true}">

        <kz.jgroup.android.umag.base.view.customs.ResizableItemsSpinner
            android:id="@+id/spinner"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical"
            android:layout_weight="1"
            android:adapterWith="@{collection}"
            android:background="@drawable/spinner_outlined_box"
            android:enabled="@{enabled == null ? true : enabled}"
            android:paddingStart="12dp"
            android:paddingTop="26dp"
            android:paddingEnd="32dp"
            android:paddingBottom="17dp"
            android:selectedItem="@={selection}"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            app:textSize="16sp"
            tools:listitem="@layout/item_spinner_inline" />

        <androidx.appcompat.widget.AppCompatTextView
            android:id="@+id/hint"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginStart="8dp"
            android:background="@color/white"
            android:paddingLeft="4dp"
            android:paddingRight="4dp"
            android:text="@{hintText}"
            android:textColor="@color/focusable_color"
            android:textSize="14sp"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            tools:text="Подсказка" />


        <androidx.appcompat.widget.AppCompatTextView
            android:id="@+id/helper_text_view"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginStart="4dp"
            android:layout_marginTop="5dp"
            android:emptyToGone="@{helperText}"
            android:textColor="@color/focusable_color"
            android:textSize="12sp"
            app:layout_constraintStart_toStartOf="@+id/hint"
            app:layout_constraintTop_toBottomOf="@+id/spinner"
            tools:text="Вспомогательное сообщение" />

    </androidx.constraintlayout.widget.ConstraintLayout>

</layout>

我希望从稳定的3.5.0升级到稳定的3.5.1,一切都会好起来,但正如你所看到的,它不是((

用3.5.2修复了:

问题本身:


一周前我问过,我应该在Google Tracker中打开这个问题吗?
        boolean enabledJavaLangObjectNull = false;
        ? selectionGetValue = null; //Illegal start of expression
        java.lang.Object collection = mCollection;
        boolean enabledJavaLangObjectNullBooleanTrueEnabled = false;
        java.lang.String helperText = mHelperText;
        androidx.lifecycle.MutableLiveData<?> selection = mSelection;
        java.lang.String hintText = mHintText;
        java.lang.Boolean enabled = mEnabled;
        boolean enabledJavaLangObjectNull = false;
        java.lang.Object selectionGetValue = null;
        java.lang.Object collection = mCollection;
        boolean enabledJavaLangObjectNullBooleanTrueEnabled = false;
        java.lang.String helperText = mHelperText;
        androidx.lifecycle.MutableLiveData selection = mSelection;
        java.lang.String hintText = mHintText;
        java.lang.Boolean enabled = mEnabled;