I'm encountering a weird issue and i'm kinda at lo...
# compose
m
I'm encountering a weird issue and i'm kinda at loss to figure out what is causing it. With one of my @Composable with AndroidView when adding
Copy code
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"
On orientation change it throws:
Copy code
java.lang.IllegalStateException: pending composition has not been applied
        at androidx.compose.runtime.CompositionImpl.drainPendingModificationsForCompositionLocked(Composition.kt:443)
        at androidx.compose.runtime.CompositionImpl.composeContent(Composition.kt:475)
        at androidx.compose.runtime.Recomposer.composeInitial$runtime_release(Recomposer.kt:726)
        ...
By removing either
orientation
OR
screenSize
, it behaves correctly. AndroidView factory is being fed an instance of 3rd party charting module that i persist in ViewModel to preserve its state (zoom/pan etc.) , if i give it fresh instance , the issue will not occur (but i lose the state of the chart obv.)
r
Did you by any chance find a solution to this issue? 1 year later and i find myself in a similar predicament.