Status Update
Comments
li...@gmail.com <li...@gmail.com> #2
I'm using paging "3.1.1" version with
implementation("androidx.paging:paging-runtime:3.1.1")
implementation("androidx.paging:paging-compose:1.0.0-alpha15")
everything good with compose
implementation("androidx.paging:paging-runtime:3.1.1")
implementation("androidx.paging:paging-compose:1.0.0-alpha15")
everything good with compose
nj...@google.com <nj...@google.com>
du...@google.com <du...@google.com> #3
The latest alpha of paging-compose
requires 3.2.0-alpha of paging-common
, but paging-runtime:3.1.1
depends on a version of paging-common before 3.2.0-alpha.
You can fix this by updating to
implementation("androidx.paging:paging-runtime:3.2.0-alpha01")
du...@google.com <du...@google.com> #4
So on further thought, I think we can add a dependency constraint to disallow the combination of paging-runtime:3.1.x
with paging-compose:1.0.0-alpha15
.
Description
Jetpack Compose component(s) used: paging 3
Android Studio Build:Android studio chipmunk| 2021.2.1 Patch 1
Kotlin version: 1.6.10
Steps to Reproduce or Code Sample to Reproduce:
1.Create Paging adapter
class GalleryAdapter : PagingDataAdapter<GalleryImageItem,GalleryAdapter.ViewHolder>(diff) {
object diff: DiffUtil.ItemCallback<GalleryImageItem>() {
override fun areItemsTheSame(
oldItem: GalleryImageItem,
newItem: GalleryImageItem
): Boolean {
return oldItem.filePath == newItem.filePath
}
override fun areContentsTheSame(
oldItem: GalleryImageItem,
newItem: GalleryImageItem
): Boolean {
return oldItem.displayImageSize == newItem.displayImageSize && oldItem.selectedIndex == newItem.selectedIndex
}
}
inner class ViewHolder ......{
}
}
2. Init adapter inside Fragment
3. throw runtime exception
Stack trace (if applicable):
E/AndroidRuntime: Caused by: 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/~~0P9PWUHdOHhzQLVpmfGYzw==/documentscanner.co-og8YVJEre4tPInWhsAEk1g==/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 documentscanner.co.presentation.ui.camerascan.gallery.GalleryAdapter.<init>(GalleryAdapter.kt:13)
<add stack trace here>
```