What does this: `Caused by: java.lang.IllegalState...
# compose
l
What does this:
Caused by: java.lang.IllegalStateException: Composition requires an active composition context
mean? What are the possible causes?
k
based on the some quick search seems like the composition context is for to contain the Slot Table and it it referenced as a
root
. My assumption based on that is you are calling a compose function without a root to be able to attach itself.
if you comment out the
SetContent
function in your activity you can achieve the same result:
Copy code
//setContent {
        epicContent()
//}
r
It sounds like you're calling a composable function outside of a composable function - it's like suspend, they can only be called from other composables
l
Trying to debug it, I have a breakpoint inside every
@Composable
function I have, it crashed before even reaching any breakpoints :s
r
what's the stack trace?
l
Found out what was the problem 🙂
Was using some composable functions (
+state
) to assign values to
val
, outside of a
@composable
function
Not only in function though
You could declare them as I did in a class
c
@kioba That is the plan. We plan make effects
@Composable
functions that return values. When that is done they will be reported as errors just as trying to call an
@Composable
outside and
@Composable
is an error.
👍 2