Why can't I call `remember` inside an inline funct...
# compose
h
Why can't I call
remember
inside an inline function? 🤔
l
is the inline function composable?
like other composable functions, remember can only be called inside a composable function
h
Yeah... It is
l
can you paste the code here?
h
Copy code
@JvmOverloads
@Composable
inline fun <reified T> inject(
    qualifier: Qualifier? = null,
    noinline parameters: ParametersDefinition? = null
): Lazy<T> = remember {
    val context = KoinContextHandler.get()
    context.inject()
}
I'm trying Koin + Compose.
that's the error message
Copy code
e: org.jetbrains.kotlin.codegen.CompilationException: Back-end (JVM) Internal error: Couldn't inline method call 'remember' into
@kotlin.jvm.JvmOverloads @androidx.compose.Composable public inline fun <reified T> inject
l
can you try removing
@JvmOverloads
and see if that does anything?
h
@Leland Richardson [G] My mistake. I added
Copy code
buildFeatures {
    compose true
}
To my compose android module
l
ah, and it worked after that?
h
Cause I'm placing this code into a separated module
That error disappeared and another one came to me 😄
Copy code
.jar: Runtime JAR file has version 1.3 which is older than required for API version 1.4

Execution failed for task ':koin-androidx-compose:compileDebugKotlin'.
> Internal compiler error. See log for more details
I'm trying to figure it out
l
hmm
i think there are some strange 1.3/1.4 issues we run into because of our compiler version not really being either
if you search this chat some others have run into this and you might find the answer there
you might need to change your stdlib/runtime version
h
Okay... I'm gonna try to change it