Hello. I'm building a app for Android / iOS and De...
# multiplatform
l
Hello. I'm building a app for Android / iOS and Desktop. I create a module :biometric to prompt the user to use FaceID when the app open. I works on Android and iOS. For Desktop, I'm targeting JVM and macos in :composeApp (that implements :biometric). -> jvmMain I have access to the function
application{}
but not in macos -> So I cannot start my app from there -> It start on JvmMin but doesnt prompt the biometric even when jvmMain depends on macos. I'm a bit confused on how i should setup the whole thing
Copy code
jvmToolchain(17)

    androidTarget()

    listOf(
        iosX64(),
        iosArm64(),
        iosSimulatorArm64()
    ).forEach { iosTarget ->
        ...
    }

    jvm()

    macosX64()
    macosArm64()

    applyDefaultHierarchyTemplate()
Copy code
macosMain {
            dependencies {
                //inherit from commonMain, but still not accessible
                implementation(compose.runtime)
                implementation(compose.foundation)
                implementation(compose.material3)
                implementation(compose.ui)
            }
        }

        jvmMain {
            dependsOn(appleMain.get())
            dependencies {
                implementation(compose.desktop.currentOs)
                implementation(libs.kotlinx.coroutines.swing)
            }
        }
Copy code
//../composeApp/src/jvmMain/kotlin/com/louisgautier/composeApp/Main.kt

import androidx.compose.ui.window.Window
import androidx.compose.ui.window.application <-- `application` not found on macosMain
import org.koin.core.context.startKoin


fun main() =
    application {
        startKoin {
            modules(getAllModules())
        }
        Window(
            onCloseRequest = ::exitApplication,
            title = "Sample",
        ) {
            App()
        }
    }
🧵 2