找不到符号 class ActivityEngageBindingImpl
Cannot find symbol class ActivityEngageBindingImpl
我正在使用 rxjava2 + mvvvmhabit 库。如何解决这个问题?
Cannot find symbol class ActivityEngageBindingImpl
[databinding] {"msg":"Cannot resolve type \u0027LayoutManagers\u0027",
"file":"app/src/main/res/layout/activity_engage.xml",
"pos":[{"line0":34,"col0":37,"line1":34,"col1":50}]}
我的activity_engage.xml文件
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt"
xmlns:binding="http://schemas.android.com/apk/res-auto"
xmlns:app="http://schemas.android.com/apk/res-auto">
<data>
<import type="me.tatarka.bindingcollectionadapter2.LayoutManagers" />
<import type="me.goldze.mvvmhabit.binding.viewadapter.recyclerview.LineManagers" />
<variable
name="viewModel"
type="com.founicy.analy.ui.activity.engage.EngageViewModel" />
</data>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.appcompat.widget.Toolbar
android:id="@+id/tb_engage"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@color/colorBackground"
android:theme="@style/ThemeOverlay.AppCompat.ActionBar"
app:titleTextAppearance="@style/CustomToolbar" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_engage_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/tb_engage"
binding:itemBinding="@{viewModel.itemBinding}"
binding:items="@{viewModel.observableList}"
binding:layoutManager="@{LayoutManagers.linear()}"
binding:lineManager="@{LineManagers.horizontal()}"
android:scrollbarSize="3dp"
android:scrollbarThumbVertical="@drawable/scroll_bar_color"
android:scrollbars="vertical" />
<LinearLayout
android:id="@+id/ll_empty_engage"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:gravity="center"
android:orientation="vertical"
android:visibility="@{viewModel.llEmptyEngageVisible}">
<ImageView
android:layout_width="56dp"
android:layout_height="56dp"
android:src="@drawable/ic_data_empty" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/date_empty"
android:textColor="@color/textGrey"
android:textSize="@dimen/engage_card_text" />
</LinearLayout>
<ProgressBar
android:id="@+id/pb_engage"
style="@style/Widget.AppCompat.ProgressBar.Horizontal"
android:layout_width="match_parent"
android:layout_height="3dp"
android:layout_alignParentTop="true"
android:visibility="gone" />
</RelativeLayout>
</layout>
请使用以前版本的库。您应该删除 4.0.0 并使用 2.2.0
implementation 'me.tatarka.bindingcollectionadapter2:bindingcollectionadapter:4.0.0'
implementation 'me.tatarka.bindingcollectionadapter2:bindingcollectionadapter-recyclerview:4.0.0'
implementation 'me.tatarka.bindingcollectionadapter2:bindingcollectionadapter-viewpager2:4.0.0'
使用2.2.0版本
implementation 'me.tatarka.bindingcollectionadapter2:bindingcollectionadapter:2.2.0'
implementation 'me.tatarka.bindingcollectionadapter2:bindingcollectionadapter-recyclerview:2.2.0'
我正在使用 rxjava2 + mvvvmhabit 库。如何解决这个问题?
Cannot find symbol class ActivityEngageBindingImpl
[databinding] {"msg":"Cannot resolve type \u0027LayoutManagers\u0027",
"file":"app/src/main/res/layout/activity_engage.xml",
"pos":[{"line0":34,"col0":37,"line1":34,"col1":50}]}
我的activity_engage.xml文件
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt"
xmlns:binding="http://schemas.android.com/apk/res-auto"
xmlns:app="http://schemas.android.com/apk/res-auto">
<data>
<import type="me.tatarka.bindingcollectionadapter2.LayoutManagers" />
<import type="me.goldze.mvvmhabit.binding.viewadapter.recyclerview.LineManagers" />
<variable
name="viewModel"
type="com.founicy.analy.ui.activity.engage.EngageViewModel" />
</data>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.appcompat.widget.Toolbar
android:id="@+id/tb_engage"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@color/colorBackground"
android:theme="@style/ThemeOverlay.AppCompat.ActionBar"
app:titleTextAppearance="@style/CustomToolbar" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_engage_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/tb_engage"
binding:itemBinding="@{viewModel.itemBinding}"
binding:items="@{viewModel.observableList}"
binding:layoutManager="@{LayoutManagers.linear()}"
binding:lineManager="@{LineManagers.horizontal()}"
android:scrollbarSize="3dp"
android:scrollbarThumbVertical="@drawable/scroll_bar_color"
android:scrollbars="vertical" />
<LinearLayout
android:id="@+id/ll_empty_engage"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:gravity="center"
android:orientation="vertical"
android:visibility="@{viewModel.llEmptyEngageVisible}">
<ImageView
android:layout_width="56dp"
android:layout_height="56dp"
android:src="@drawable/ic_data_empty" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/date_empty"
android:textColor="@color/textGrey"
android:textSize="@dimen/engage_card_text" />
</LinearLayout>
<ProgressBar
android:id="@+id/pb_engage"
style="@style/Widget.AppCompat.ProgressBar.Horizontal"
android:layout_width="match_parent"
android:layout_height="3dp"
android:layout_alignParentTop="true"
android:visibility="gone" />
</RelativeLayout>
</layout>
请使用以前版本的库。您应该删除 4.0.0 并使用 2.2.0
implementation 'me.tatarka.bindingcollectionadapter2:bindingcollectionadapter:4.0.0'
implementation 'me.tatarka.bindingcollectionadapter2:bindingcollectionadapter-recyclerview:4.0.0'
implementation 'me.tatarka.bindingcollectionadapter2:bindingcollectionadapter-viewpager2:4.0.0'
使用2.2.0版本
implementation 'me.tatarka.bindingcollectionadapter2:bindingcollectionadapter:2.2.0'
implementation 'me.tatarka.bindingcollectionadapter2:bindingcollectionadapter-recyclerview:2.2.0'