I'm getting a compilation exception on my project....
# compose
h
I'm getting a compilation exception on my project.
Copy code
e: org.jetbrains.kotlin.codegen.CompilationException: Back-end (JVM) Internal error: Couldn't transform method node:
NewItem (Lkotlin/jvm/functions/Function1;Landroidx/compose/ui/Modifier;Landroidx/compose/runtime/Composer;III)V:
It is hard for me to pinpoint exactly where it goes wrong because the stacktrace is rather large and there are no warnings on Android Studio. I'm sharing a gist which includes the whole stacktrace. https://gist.github.com/halilozercan/303908615b54f1bc29e6355515545018
A clue: it might have something to do with
rememberCoroutineScope
First impression is slightly wrong. If I specify a coroutineContext as the only argument to
rememberCoroutineScope
Copy code
rememberCoroutineScope { <http://Dispatchers.IO|Dispatchers.IO> }
This compilation error occurs.
z
I just hit this as well on dev17.
rememberCoroutineScope()
works fine,
rememberCoroutineScope { Dispatchers.Main.immediate }
crashes. Will try to get a reproducer in a bit.
👍 1
Filed: https://issuetracker.google.com/issues/165674304 Reproducer is as simple as just calling
rememberCoroutineScope
and passing a lambda.
Workaround is just calling it without a lambda, then using a separate
remember
to add on whatever you need to the context.
h
Thanks for taking the time and reporting it @Zach Klippenstein (he/him) [MOD]. I had forgotten about this issue after realizing the workaround you've just sent 😕