Open Bela-Szilagyi opened 2 years ago
I was also able to reproduce this issue. To mitigate this issue I downgrading firebase UI components to 7.2.0
implementation 'com.firebaseui:firebase-ui-auth:7.2.0'
implementation 'com.firebaseui:firebase-ui-database:7.2.0'
I also experience this with version 8.0.2.
I also ran into the same issue with version 8.0.2.
This commit removed notifyDataSetChanged()
from FirebaseRecyclerAdapter, so the process of notifying the adapter about changes is now gone. This is the cause of RecyclerView and java.lang.IndexOutOfBoundsException: Inconsistency detected
.
Text submissions are reflected in the RecyclerView without any problems, however, images don’t work well because adapter.stopListening() is called during image selection at onPause.
A simple solution is to add the following code to FriendlyMessageAdapter:
override fun stopListening() {
super.stopListening()
notifyDataSetChanged()
}
I can catch the exception using this wrapper, and then everything goes fine, but it is not the properr way... class LlmWrapper(context: Context) : LinearLayoutManager(context) { override fun onLayoutChildren(recycler: RecyclerView.Recycler?, state: RecyclerView.State?) { Log.i("olc", state.toString()) try { super.onLayoutChildren(recycler, state) } catch (e: Exception) { Log.e("olc", "$e.localizedMessage") } } }