Hey, my team is completely lost on what could caus...
# kotlin-native
j
Hey, my team is completely lost on what could cause such an error when running
./gradlew iosSimulatorArm64Test
Maybe there is some sub-dependency that is misaligned such as described here? https://kotlinlang.org/docs/whatsnew19.html#library-linkage-in-kotlin-native Logs:
Copy code
kotlin.native.internal.IrLinkageError: Function 'CanvasLayersComposeScene' can not be called: No function found for symbol 'androidx.compose.ui.scene/CanvasLayersComposeScene|CanvasLayersComposeScene(androidx.compose.ui.unit.Density;androidx.compose.ui.unit.LayoutDirection;androidx.compose.ui.unit.IntSize?;kotlin.coroutines.CoroutineContext;androidx.compose.ui.scene.ComposeSceneContext;kotlin.Function0<kotlin.Unit>){}[0]'
kotlin.native.internal.IrLinkageError: Function 'CanvasLayersComposeScene' can not be called: No function found for symbol 'androidx.compose.ui.scene/CanvasLayersComposeScene|CanvasLayersComposeScene(androidx.compose.ui.unit.Density;androidx.compose.ui.unit.LayoutDirection;androidx.compose.ui.unit.IntSize?;kotlin.coroutines.CoroutineContext;androidx.compose.ui.scene.ComposeSceneContext;kotlin.Function0<kotlin.Unit>){}[0]'
	at kotlin.Throwable#<init>(/opt/buildAgent/work/7377bd4dc65e1c03/kotlin/kotlin-native/runtime/src/main/kotlin/kotlin/Throwable.kt:30)
	at kotlin.Error#<init>(/opt/buildAgent/work/7377bd4dc65e1c03/kotlin/kotlin-native/runtime/src/main/kotlin/kotlin/Exceptions.kt:12)
	at kotlin.native.internal.IrLinkageError#<init>(/opt/buildAgent/work/7377bd4dc65e1c03/kotlin/kotlin-native/runtime/src/main/kotlin/kotlin/native/internal/RuntimeUtils.kt:133)
	at kotlin.native.internal#ThrowIrLinkageError(/opt/buildAgent/work/7377bd4dc65e1c03/kotlin/kotlin-native/runtime/src/main/kotlin/kotlin/native/internal/RuntimeUtils.kt:137)
	at androidx.compose.ui.test.SkikoComposeUiTest.createUi#internal(/opt/buildAgent/work/8a20760945d0aeba/compose/ui/ui-test/src/skikoMain/kotlin/androidx/compose/ui/test/ComposeUiTest.skikoMain.kt:221)
	at androidx.compose.ui.test.SkikoComposeUiTest.SkikoComposeUiTest$withScene$$FUNCTION_REFERENCE_FOR$createUi$1.invoke#internal(/opt/buildAgent/work/8a20760945d0aeba/compose/ui/ui-test/src/skikoMain/kotlin/androidx/compose/ui/test/ComposeUiTest.skikoMain.kt:194)
	at kotlin.Function0#invoke(/Users/teamcity/.gradle/daemon/8.11.1/[K][Suspend]Functions:1)
//...
Hmmm.. its probably because canvas was removed so thats why it cannot be found (https://github.com/JetBrains/compose-multiplatform-core/pull/1680) but why does it fail the tests only and still let me run the app?
п
It fails only when you try to call removed function. If you don't call it it's fine.
Are you sure that all parts of compose library are same version in your setup?
j
Hey thanks for the reply. What are exactly are the removed functions? I have tried commenting everything about canvas but it doesn’t work. This started failing in CI for JVM and iOS (the logs in the OP) when we upgraded to Compose multiplatform 1.8.0
.
I’m pretty sure everything is the same version. I’ll double check when I get back to the office.
p
Typically this error can happen in following scanario. There is a
app -> libA -> libB
dependency chain.
libA
is using some function
foo
from
libB
, which is removed in new version of
libB
. If you upgrade
libB
but not
libA
you would see this error. In your case, it looks like, that
SkikoComposeUiTest.createUi
is comming from older version than other parts of compose.
j
We had forgotten to update the project level compose dependency 🤦‍♂️
🫠 1