When I try to run UI tests in my `jvm` Compose Pro...
# compose-desktop
c
When I try to run UI tests in my
jvm
Compose Project, I immediately get an exception
Copy code
'void org.jetbrains.skia.paragraph.ParagraphStyleKt._nSetTextIndent(long, float, float)'
java.lang.UnsatisfiedLinkError: 'void org.jetbrains.skia.paragraph.ParagraphStyleKt._nSetTextIndent(long, float, float)'
	at org.jetbrains.skia.paragraph.ParagraphStyleKt._nSetTextIndent(Native Method)
	at org.jetbrains.skia.paragraph.ParagraphStyleKt.access$_nSetTextIndent(ParagraphStyle.kt:1)
	at org.jetbrains.skia.paragraph.ParagraphStyle.setTextIndent(ParagraphStyle.kt:182)
	at androidx.compose.ui.text.platform.ParagraphBuilder.textStyleToParagraphStyle(SkiaParagraph.skiko.kt:776)
	at androidx.compose.ui.text.platform.ParagraphBuilder.build(SkiaParagraph.skiko.kt:566)
	at androidx.compose.ui.text.platform.ParagraphLayouter.<init>(ParagraphLayouter.skiko.kt:71)
as soon as the Composable under test contains a
Text(String)
, so this fails:
Copy code
class ComposeTest {
    @get:Rule
    val composeTestRule = createComposeRule()
    @Test
    fun firstTest() {
        composeTestRule.setContent {
            Text("Hello")
        }
    }
}
whereas this does not:
Copy code
class ComposeTest {
    @get:Rule
    val composeTestRule = createComposeRule()
    @Test
    fun firstTest() {
        composeTestRule.setContent {
            Button({}){}
        }
    }
}
Does anyone have an idea what the problem could be?
k
Looks like it can’t find the Skiko jar for your platform (that has that native-level Skia bindings)
j
but it would be weird if the Button could correctly render without the Skiko jar.
possibly the wrong version of skiko, but unclear how someone would get into such a situation.
@Christian Lutnik It's not entirely clear just from the stack trace alone, but it looks like a configuration issue. I'd recommend taking a look at one of the samples in https://github.com/JetBrains/compose-jb/tree/master/templates and try to figure out the difference.
Specifically, it seems that somehow the native skiko binaries which needed to be loaded for that platform, are not being loaded/linked correctly.
k
https://github.com/JetBrains/skiko/commit/8fccb7ea8c6cebc9fa399f35c0656cba986a239c added that
setTextIndent
binding back in March. So it’s not a recent change
c
thank you, I was using an outdated version of compose 👍