Android Compose AdapterList update data Asynchronously
I've seen this a few times myself with both lists downloading images like you're describing and also lists without any async work being done, but I don't think it's caused by anything we're specifically doing. My impression is that it's just a bug with the current state of Compose.
That being said, AndroidComposeViewAccessibilityDelegateCompat is at least one class that handles this error and references an internal Issue Tracker ticket that's indicating it will be fixed in Android R, at least for that instance.
} catch (e: IllegalStateException) {
// We may get "Asking for measurement result of unmeasured layout modifier" error.
// TODO(b/153198816): check whether we still get this exception when R is in.
info.setBoundsInScreen(android.graphics.Rect())
}
There's also an upcoming change in dev11
that updates AdapterList
to dispose of compositions scrolled off screen and I'm curious to see how this affects things.
And if you're just curious about where the error is being thrown you can check out LayoutNodeWrapper._measureResult.