'FirestorePagingAdapter crashes when scrolling in version 8.0.1

After updating FirebaseUi from implementation 'com.firebaseui:firebase-ui-firestore:8.0.0' to implementation 'com.firebaseui:firebase-ui-firestore:8.0.1' FirestorePagingAdapter crashes when I scroll the RecyclerView. I think it always crashes at the same position, maybe at this position it loads new items for the first time.

I get the following crashlog:

java.lang.IllegalStateException: The same value, PageKey{StartAfter=1MbZLsOSoWUPAdDnNOGlthxGjDC2 - 02:52:33 - 11.04.2022, EndBefore=null}, was passed as the nextKey in two
 sequential Pages loaded from a PagingSource. Re-using load keys in
 PagingSource is often an error, and must be explicitly enabled by
 overriding PagingSource.keyReuseSupported.
    at androidx.paging.PageFetcherSnapshot.doLoad(PageFetcherSnapshot.kt:419)
    at androidx.paging.PageFetcherSnapshot.access$doLoad(PageFetcherSnapshot.kt:54)
    at androidx.paging.PageFetcherSnapshot$doLoad$1.invokeSuspend(Unknown Source:15)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
    at android.os.Handler.handleCallback(Handler.java:938)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:233)
    at android.app.ActivityThread.main(ActivityThread.java:8063)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:631)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:978)


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source