arkivanov / Decompose

Kotlin Multiplatform lifecycle-aware business logic components (aka BLoCs) with routing (navigation) and pluggable UI (Jetpack Compose, SwiftUI, JS React, etc.)
https://arkivanov.github.io/Decompose
Apache License 2.0
2.23k stars 84 forks source link

import object field 'org_jetbrains_skia_DirectContext__1nFlushDefault' is not a Function #785

Closed SamuelMarks closed 1 month ago

SamuelMarks commented 1 month ago

Occurs when running wasmJsBrowserRun -t on the latest Compose Wizard generated codebase with the following modifications:

[versions]
decompose = "3.2.0-beta01"
essenty = "2.2.0-beta01"

[libraries]
decompose-decompose = { module = "com.arkivanov.decompose:decompose", version.ref = "decompose" }
decompose-extensions-compose = { module = "com.arkivanov.decompose:extensions-compose", version.ref = "decompose" }
essenty-lifecycle = { module = "com.arkivanov.essenty:lifecycle", version.ref = "essenty" }

(also tried with the older syntax)

kotlin {
    listOf(
        iosX64(),
        iosArm64(),
        iosSimulatorArm64()
    ).forEach { iosTarget ->
        iosTarget.binaries.framework {
            baseName = "ComposeApp"
            isStatic = true
            export(libs.decompose.decompose)
            export(libs.essenty.lifecycle)
        }
    }
kotlin {
    sourceSets {
        commonMain.dependencies {
            api(libs.decompose.decompose)
            api(libs.decompose.extensions.compose)
            api(libs.essenty.lifecycle)
        }

Using the older/stable versions worked without err:

decompose = "3.1.0"
essenty = "2.1.0"
arkivanov commented 1 month ago

Thanks for reporting! This might be some kind of a binary compatibility issue. Decompose version 3.1.0 uses Multiplatform Compose version 1.6.10. So please try using that version of Compose. Otherwise, this looks like a bug in Compose for Wasm or Kotlin/Wasm. I suggest to report it on YouTrack.

arkivanov commented 1 month ago

Please see (if you are registered in Kotlinlang Slack): https://kotlinlang.slack.com/archives/C01F2HV7868/p1725398388346079

Compose versions need to be aligned.

SamuelMarks commented 1 month ago

Upgrading from compose-plugin = "1.6.11" to compose-plugin = "1.7.0-rc01" resolved this issue.