Status Update
Comments
cl...@google.com <cl...@google.com> #2
I have updated androidx.room:room-paging 2.5.0-alpha02 and androidx-paging to 3.2.0-alpha01 respectively but seems the cause is androidx.room:room-paging is adding the transitive dependency for paging-common 3.1.1.
[33m| +--- [39mandroidx.room:room-paging:2.5.0-alpha02
[33m| | +--- [39mandroidx.paging:paging-common:3.1.1
The lib or some lib has marked paging-common to be strictly 3.1.1 instead of 3.2.0-alpha02.
androidx.paging:paging-common:{strictly 3.1.1} -> 3.1.1
This caused the app to be always using paging-common 3.1.1 which PagingDataDiffer class does not have the updated constructor yet.
ys...@google.com <ys...@google.com> #3
Please include a sample project that reproduces your issue. None of the room-paging
artifacts have any strict dependencies on Paging.
ys...@google.com <ys...@google.com> #4
There shouldn't be a strict version requirement, room-paging depending on paging-common:3.1.1 should be able to get upgraded to 3.2.0-alpha01.
By any chance are you hitting this while running an instrumented test? The version of paging should resolve the same between for both the main apk and test apk, but the way this is exposed is unfortunately as a version requirement.
Otherwise, if you can share your build.gradle
it would help us reproduce the issue, it's possible we're missing a version constraint that could better guide how Gradle resolves the paging-common version.
cl...@google.com <cl...@google.com> #5
Hi, no we are not using during instrumented test but just a normal run from AS will encounter the crash.
Not sure what went wrong but excluding the transitive dependency group androidx.paging from room-paging seems to work and androidx.paging:paging-common:3.1.1 no longer shown as strictly in the app:dependencies task.
ap...@google.com <ap...@google.com> #6
If you're able to reproduce this in a sample project, please attach it here and we can reopen the issue and take a look.
ap...@google.com <ap...@google.com> #7
I also ran into this, it is fairly easy to reproduce on my end. I need to add dependency on both paging-runtime
and paging-compose
:
implementation 'androidx.paging:paging-runtime:3.1.1'
implementation 'androidx.paging:paging-compose:1.0.0-alpha15'
And then eg. creating a PagingDataAdapter
will cause a crash:
val adapter = object : PagingDataAdapter<String, RecyclerView.ViewHolder>(object : DiffUtil.ItemCallback<String>() {
override fun areItemsTheSame(oldItem: String, newItem: String) = true
override fun areContentsTheSame(oldItem: String, newItem: String) = true
}) {
override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) = TODO()
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int) = TODO()
}
java.lang.NoSuchMethodError: No direct method <init>(Landroidx/paging/DifferCallback;Lkotlinx/coroutines/CoroutineDispatcher;)V in class Landroidx/paging/PagingDataDiffer; or its super classes (declaration of 'androidx.paging.PagingDataDiffer' appears in /data/app/~~QVBQXUo_41J0PPyeyQkLkA==/com.example.pagingcrashrepro-b6_Qq8aKQlwtI2MEGllfnw==/base.apk)
at androidx.paging.AsyncPagingDataDiffer$differBase$1.<init>(AsyncPagingDataDiffer.kt:78)
at androidx.paging.AsyncPagingDataDiffer.<init>(AsyncPagingDataDiffer.kt:78)
at androidx.paging.PagingDataAdapter.<init>(PagingDataAdapter.kt:78)
at androidx.paging.PagingDataAdapter.<init>(PagingDataAdapter.kt:61)
at com.example.pagingcrashrepro.MainActivity$onCreate$adapter$1.<init>(MainActivity.kt:17)
at com.example.pagingcrashrepro.MainActivity.onCreate(MainActivity.kt:17)
at android.app.Activity.performCreate(Activity.java:8054)
at android.app.Activity.performCreate(Activity.java:8034)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1341)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3666)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3842)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:103)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2252)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:201)
at android.os.Looper.loop(Looper.java:288)
at android.app.ActivityThread.main(ActivityThread.java:7842)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
If I downgrade paging dependency to alpha14
, the crash does not happen.
cl...@google.com <cl...@google.com> #8
You must use paging 3.2.0-alpha01
with paging-compose:1.0.0-alpha15
.
cl...@google.com <cl...@google.com> #9
You must use paging
3.2.0-alpha01
withpaging-compose:1.0.0-alpha15
.
Ok, then I have a couple of follow ups, in no particular order:
- Is this documented somewhere?
- Why does it not fail at compile time, instead of runtime?
- Why doesn't
paging-compose:1.0.0-alpha15
then force the other dependency to update to3.2.0-alpha01
? - If there is no other way that to fail at runtime, could there be a better error message at least?
na...@google.com <na...@google.com> #10
Re
If you have a sample project where you are not seeing that happen automatically, please attach it here.
Description
Version used:
androidx.paging:paging-runtime:3.1.1
androidx.paging:paging-compose:1.0.0-alpha17
Devices/Android versions reproduced on: n/a
I'm trying to use the Paging 3 library for my Wear OS app, but I am unable to put the LazyPagingItems from my Pager implementation on a ScalingLazyColumn in the UI. I notice that you are able to do this for LazyColumn, but not for ScalingLazyColumn. Are there plans for ScalingLazyColumn to support LazyPagingItems?