2

I've updated the following libraries:

 - kotlin.reflect to 1.5.31
 - room.paging to 2.4.0-alpha05
 - room.ktx to 2.4.0-alpha05

and now all features of my app that use list of Room objects with Flow and Paging (all my RecyclerViews actually) crash with the following vague exception:

java.lang.AbstractMethodError: abstract method "java.lang.Object androidx.paging.PagingDataDiffer.presentNewList(androidx.paging.NullPaddedList, androidx.paging.NullPaddedList, int, kotlin.jvm.functions.Function0, kotlin.coroutines.Continuation)"
    at androidx.paging.PagingDataDiffer$collectFrom$2$1$1.invokeSuspend(PagingDataDiffer.kt:151)
    at androidx.paging.PagingDataDiffer$collectFrom$2$1$1.invoke(Unknown Source:8)
    at androidx.paging.PagingDataDiffer$collectFrom$2$1$1.invoke(Unknown Source:4)
    at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:89)
    at kotlinx.coroutines.BuildersKt__Builders_commonKt.withContext(Builders.common.kt:165)
    at kotlinx.coroutines.BuildersKt.withContext(Unknown Source:1)
    at androidx.paging.PagingDataDiffer$collectFrom$2$invokeSuspend$$inlined$collect$1.emit(Collect.kt:135)
    at kotlinx.coroutines.flow.FlowKt__ChannelsKt.emitAllImpl$FlowKt__ChannelsKt(Channels.kt:62)
    at kotlinx.coroutines.flow.FlowKt__ChannelsKt.access$emitAllImpl(Channels.kt:1)
    at kotlinx.coroutines.flow.FlowKt__ChannelsKt$emitAllImpl$1.invokeSuspend(Unknown Source:14)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
    at kotlinx.coroutines.EventLoop.processUnconfinedEvent(EventLoop.common.kt:69)
    at kotlinx.coroutines.DispatchedTaskKt.resumeUnconfined(DispatchedTask.kt:244)
    at kotlinx.coroutines.DispatchedTaskKt.dispatch(DispatchedTask.kt:161)
    at kotlinx.coroutines.CancellableContinuationImpl.dispatchResume(CancellableContinuationImpl.kt:398)
    at kotlinx.coroutines.CancellableContinuationImpl.completeResume(CancellableContinuationImpl.kt:514)
    at kotlinx.coroutines.channels.AbstractChannel$ReceiveElement.completeResumeReceive(AbstractChannel.kt:907)
    at kotlinx.coroutines.channels.ArrayChannel.offerInternal(ArrayChannel.kt:83)
    at kotlinx.coroutines.channels.AbstractSendChannel.send(AbstractChannel.kt:134)
    at androidx.paging.PageFetcherSnapshot.doInitialLoad(PageFetcherSnapshot.kt:318)
    at androidx.paging.PageFetcherSnapshot.access$doInitialLoad(PageFetcherSnapshot.kt:55)
    at androidx.paging.PageFetcherSnapshot$doInitialLoad$1.invokeSuspend(Unknown Source:14)
    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:246)
    at android.app.ActivityThread.main(ActivityThread.java:8512)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1130)

If I restore the previous version of the libraries everything works fine once again. Please help !

NOTE:

Do not bind this question to the following one: Paging crash because the answer to that question is not even related to this one because the Compose package is not used or even included in my project, and it doesn't work ( I tested it).

Sergiob
  • 838
  • 1
  • 13
  • 28

1 Answers1

10

Use Paging 3.1.0-beta01 to fix, or revert Room back to stable 2.3.0.

The Paging library seems to have broken binary compatibility between 3.0.x and 3.1.0, and Room 2.4.0-alpha05+ is using the updated contract.

This is most likely related to the new room-paging library. They talk a lot about new paging interop requirements in the release notes, but I don't see anything which calls out strict version requirements. https://developer.android.com/jetpack/androidx/releases/room#2.4.0-beta01

RBusarow
  • 644
  • 7
  • 12
  • To make it work I must restore the previous version, that is clear. But that means I only delay the problem. I need a fix for the new package, at least if that is not a bug in the package. If it is a bug, than it is clearly fine for me – Sergiob Oct 15 '21 at 07:15
  • The fix is to use compatible dependencies. As it is right now, if you want to use the Room beta with Paging you must also use the Paging beta. – RBusarow Oct 15 '21 at 18:25
  • Changing paging to 3.1.0-beta01 is the way to go. Thanks – Sergiob Oct 19 '21 at 13:08