I got exception [thread] when move function from a...
# compose
i
I got exception [thread] when move function from app module to multiplatform module. When it was in app all compiles and build, but after moving i can not compile project
compose build feature enabled and compose compiler the same version as in app
build.gradle.kts looks like this
Copy code
@file:Suppress("UNUSED_VARIABLE")

import ru.rt.buildsrc.android.*
import ru.rt.buildsrc.iOS
import ru.rt.buildsrc.util.implement

plugins {
    kotlin("multiplatform")
    id("com.android.library")
}

android {
    compileSdk = Versions.Android.compileSdk
    sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml")
    defaultConfig {
        minSdk = Versions.Android.minSdk
        targetSdk = Versions.Android.targetSdk
    }

    buildTypes(action = { createAppBuildTypes() })
    compileOptions {
        sourceCompatibility = Versions.javaVersion
        targetCompatibility = Versions.javaVersion
    }
    commonLintSettings(fileFactory)
    with(configurations) {
        (ru.rt.buildsrc.android.BuildTypes.names() + "")
            .forEach(::createConfigurations)
    }
    
    

    buildFeatures {
        compose = true
    }

    composeOptions {
        kotlinCompilerExtensionVersion = Versions.Compose.main
    }
}

kotlin {
    android()
    iOS()
    sourceSets {
        val commonMain by getting {
            dependencies {
                implement(Dependencies.Modules.libShared)
                implementation(Dependencies.Kotlin.coroutines)
                implementation(Dependencies.Kodein.core)
            }
        }
        val androidMain by getting {
            dependencies {
                implementation(Dependencies.AndroidX.appcompat)
                implementation(Dependencies.Compose.foundation)
            }
        }
        val iosMain by getting
    }
}
function thatcan not be compiled is just simple composable function that get factory as parameter and remember result inside mutable state
something like this
Copy code
@Composable
fun <Component : DkmpScope> BindScope(
    provideComponent: () -> Component,
    content: @Composable (Component) -> Unit
) {

    val component by remember { mutableStateOf(provideComponent()) }
    content(component)
}