question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

java.lang.UnsatisfiedLinkError when using `isSystemInDarkTheme` with v1.1.0-alpha02

See original GitHub issue

After updating to version 1.1.0-alpha02 this code:

androidx.compose.foundation.isSystemInDarkTheme()

crashes with the following exception on desktop:

Exception in thread "main" java.lang.UnsatisfiedLinkError: 'int org.jetbrains.skiko.SystemTheme_awtKt.getCurrentSystemTheme()'
        at org.jetbrains.skiko.SystemTheme_awtKt.getCurrentSystemTheme(Native Method)
        at org.jetbrains.skiko.SystemTheme_awtKt.getCurrentSystemTheme(SystemTheme.awt.kt:4)
        at androidx.compose.foundation.DarkTheme_desktopKt._isSystemInDarkTheme(DarkTheme.desktop.kt:48)
        at androidx.compose.foundation.DarkThemeKt.isSystemInDarkTheme(DarkTheme.kt:41)
        at com.superthomaslab.hueessentials.common.ui.ThemeKt.HueEssentialsTheme(Theme.kt:33)
        at ComposableSingletons$MainKt$lambda-1$1$1.invoke(main.kt:74)
        at ComposableSingletons$MainKt$lambda-1$1$1.invoke(main.kt:65)
        at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:107)
        at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
        at DesktopLocaleHelper$provide$1.invoke(Locale.common.kt:179)
        at DesktopLocaleHelper$provide$1.invoke(Locale.common.kt:178)
        at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:107)
        at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
        at androidx.compose.runtime.CompositionLocalKt.CompositionLocalProvider(CompositionLocal.kt:228)
        at DesktopLocaleHelper.provide(Locale.common.kt:171)
        at ComposableSingletons$MainKt$lambda-1$1.invoke(main.kt:65)
        at ComposableSingletons$MainKt$lambda-1$1.invoke(main.kt:62)
        at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:116)
        at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
        at androidx.compose.ui.window.Application_desktopKt$application$1$1.invoke(Application.desktop.kt:116)
        at androidx.compose.ui.window.Application_desktopKt$application$1$1.invoke(Application.desktop.kt:115)
        at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:116)
        at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
        at androidx.compose.ui.window.Application_desktopKt$awaitApplication$2$1$2$1$1.invoke(Application.desktop.kt:227)
        at androidx.compose.ui.window.Application_desktopKt$awaitApplication$2$1$2$1$1.invoke(Application.desktop.kt:226)
        at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:107)
        at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
        at androidx.compose.runtime.CompositionLocalKt.CompositionLocalProvider(CompositionLocal.kt:228)
        at androidx.compose.ui.window.Application_desktopKt$awaitApplication$2$1$2$1.invoke(Application.desktop.kt:222)
        at androidx.compose.ui.window.Application_desktopKt$awaitApplication$2$1$2$1.invoke(Application.desktop.kt:220)
        at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:107)
        at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
        at androidx.compose.runtime.ActualJvm_jvmKt.invokeComposable(ActualJvm.jvm.kt:72)
        at androidx.compose.runtime.ComposerImpl$doCompose$2$5.invoke(Composer.kt:2582)
        at androidx.compose.runtime.ComposerImpl$doCompose$2$5.invoke(Composer.kt:2571)
        at androidx.compose.runtime.SnapshotStateKt__DerivedStateKt.observeDerivedStateRecalculations(DerivedState.kt:247)
        at androidx.compose.runtime.SnapshotStateKt.observeDerivedStateRecalculations(Unknown Source)
        at androidx.compose.runtime.ComposerImpl.doCompose(Composer.kt:2571)
        at androidx.compose.runtime.ComposerImpl.composeContent$runtime(Composer.kt:2522)
        at androidx.compose.runtime.CompositionImpl.composeContent(Composition.kt:478)
        at androidx.compose.runtime.Recomposer.composeInitial$runtime(Recomposer.kt:748)
        at androidx.compose.runtime.CompositionImpl.setContent(Composition.kt:433)
        at androidx.compose.ui.window.Application_desktopKt$awaitApplication$2$1$2.invokeSuspend(Application.desktop.kt:220)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
        at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318)
        at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:771)
        at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:722)
        at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:716)
        at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
        at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
        at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:741)
        at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
        at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
        at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
        at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
        at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
        at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

I am using macOS.

No issues with version 1.1.0-alpha1-dev550, this only started happening after updating to 1.1.0-alpha02. When removing the call to isSystemInDarkTheme in my project, the rest of my code works fine.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:3
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
TheMrMilchmanncommented, Jan 29, 2022

I experienced the same behavior on Windows and had a look at the source of skiko. The bug was caused by an internal restructuring which broke the function for all JVM platforms. I provided a simple/dumb fix in https://github.com/JetBrains/skiko/pull/464 but I’m not sure if this is the proper way to handle the situation.

There’s an implementation of it in https://github.com/JetBrains/skiko/blob/master/skiko/src/macosMain/kotlin/org/jetbrains/skiko/SystemTheme.macos.kt but maybe that’s still being wired for macos and other platforms

This is not related to this issue, since the snippet you linked is only for the native macOS target.

0reactions
Thomas-Voscommented, Feb 5, 2022

Looks like it was fixed in 1.1.0-alpha03.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Handle the UnsatisfiedLinkError Runtime Error in Java
The Java java.lang.UnsatisfiedLinkError is thrown when a program uses a native libaray but is unable to find it at runtime for some reason....
Read more >
java.lang.UnsatisfiedLinkError: on Linux but not Windows
The program was compiled using Java 1.6 and my VPS is running. [root@nl ~]# java -version java version "1.7.0_65" OpenJDK Runtime Environment ...
Read more >
java.lang.UnsatisfiedLinkError on library jnativesoamapi_7.1.0
When you run a java client application from client host, you may encounter the following console output error : java.lang.
Read more >
"java.lang.UnsatisfiedLinkError" when using a JAR file which ...
Informatica session with a Java transformation fails with the following error, when the Java code is designed to be dependent on a native ......
Read more >
Batik; java.lang.UnsatisfiedLinkError: no dcpr in java.library.path
Hi there, I've loaded batik (http://xmlgraphics.apache.org/batik/) into my 9i database, using loadjava, for the purposes of converting ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found