java.lang.IllegalStateException: Composition cannot be performed while another composition is in progress on ComposeView.setContent
0 reputation · 03 Sept 2021, 08:08 UTC
Goal
Determine whether invoking ComposeView.setContent from a non-UI thread is the direct cause of intermittent IllegalStateException failures, and whether the exception reflects a hard composition concurrency limit rather than a transient lifecycle race.
Constraints
The exact exception string may change between Compose runtime releases, so message matching is not a stable contract. ComposerImpl throws the error when a new composition attempt begins before the previous composition scope exits, but the public API does not clearly state whether nested setContent calls on the same ComposeView are serialized, rejected, or left undefined.
- Does
ComposeView.setContentsafely handle sequential calls from the main thread while a prior composition is still inflight? - Is off-thread invocation the only supported reproduction path, or can view attachment timing trigger the same concurrency check?
- Which Compose runtime release formalized the threading requirement for
ComposeViewcomposition?