Open Slake07 opened 5 years ago
Hello @Slake07, It seems that you data model is different than the one in the database. I cannot debug the code like this. But mostly the problem is here:
query = firebaseFirestore.collection(DBConstant.PHOTO.tableNm)
.orderBy(orderBy)
.startAfter(lastVisible)
.limit(6)
ImageDataModel.kt
}
Activity class:
I am getting below error log: java.lang.IllegalArgumentException: Invalid data. Unsupported type: com.google.firebase.firestore.QueryDocumentSnapshot at com.google.firebase.firestore.core.UserData$ParseContext.createError(com.google.firebase:firebase-firestore@@17.1.5:293) at com.google.firebase.firestore.UserDataConverter.parseScalarValue(com.google.firebase:firebase-firestore@@17.1.5:405) at com.google.firebase.firestore.UserDataConverter.parseData(com.google.firebase:firebase-firestore@@17.1.5:254) at com.google.firebase.firestore.UserDataConverter.parseQueryValue(com.google.firebase:firebase-firestore@@17.1.5:186) at com.google.firebase.firestore.Query.boundFromFields(com.google.firebase:firebase-firestore@@17.1.5:669) at com.google.firebase.firestore.Query.startAfter(com.google.firebase:firebase-firestore@@17.1.5:517) at com.firestoredemo.viewmodel.ImageDataModel.getPhotosByOrderPagination(ImageDataModel.kt:64) at com.firestoredemo.ui.fragment.BrowseFragment.getPhotosByOrder(BrowseFragment.kt:228) at com.firestoredemo.ui.fragment.BrowseFragment.access$getPhotosByOrder(BrowseFragment.kt:44) at com.firestoredemo.ui.fragment.BrowseFragment$setListener$2.onLoadMore(BrowseFragment.kt:153) at com.firestoredemo.adapter.BrowseResultAdapter$1.onScrolled(BrowseResultAdapter.kt:57)