https://kotlinlang.org logo
#compose
Title
# compose
y

Yuri Drigin

05/30/2021, 11:13 AM
Hi folks. Please help. I have crash
java.lang.IllegalStateException: pending composition has not been applied
in this code. Where I’m wrong?
s

Saiedmomen

05/30/2021, 11:58 AM
Where is it crashing?
inside Compose-navigation?
Try moving the vm init code to the composable
If you need in in top level, move it outside the navigation block and scope it to activity/fragment
y

Yuri Drigin

05/30/2021, 12:20 PM
Thanks. I found where. it’s a null pointer exception in the state inside the child composition. I was confused by no one mention in the error logs
a

Adam Powell

05/30/2021, 2:03 PM
Can you post more of the stack trace involved?
y

Yuri Drigin

05/30/2021, 2:35 PM
@Adam Powell Yep. I’ll reproduce it tomorrow and send full stack trace
a

Adam Powell

05/30/2021, 2:47 PM
It's a pretty unusual stack trace to see and under most circumstances might indicate a compose bug, but a composable function named as a verb like
SendStableTokenNav
looks suspicious, like it might be trying to perform navigation from composition. An attempt to do so might lead to that stack trace from attempting reentrant composition.