JetBrains / compose-multiplatform

Compose Multiplatform, a modern UI framework for Kotlin that makes building performant and beautiful user interfaces easy and enjoyable.
https://jetbrains.com/lp/compose-multiplatform
Apache License 2.0
16.28k stars 1.18k forks source link

Error when running desktop app with ./gradlew run #3446

Closed ghost closed 1 year ago

ghost commented 1 year ago

Describe the bug I'm running Termux with xfce4 with compose all platforms at once template with openjdk 17 and when I run ./gradlew run I get error about libGL.so.1 library not found, (log at last)

Affected platforms Select one of the platforms below:

Versions

To Reproduce Steps and/or the code snippet to reproduce the behavior:

  1. Setup Termux with xfce4 GUI qith termux-x11
  2. Run gradlew run in termux
  3. See error

Expected behavior Should Run

Logs

> Task :desktopApp:run
Exception in thread "main" java.lang.UnsatisfiedLinkError: /data/data/com.termux/files/home/.skiko/664c862db42629565e1dd3eaaf7b5b1452f4b8472a7769a15f7e6b981ca36e1a/libskiko-linux-arm64.so: dlopen failed: library "libGL.so.1" not found: needed by /data/data/com.termux/files/home/.skiko/664c862db42629565e1dd3eaaf7b5b1452f4b8472a7769a15f7e6b981ca36e1a/libskiko-linux-arm64.so in namespace (default)
        at java.base/jdk.internal.loader.NativeLibraries.load(Native Method)
        at java.base/jdk.internal.loader.NativeLibraries$NativeLibraryImpl.open(NativeLibraries.java:384)
        at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:228)
        at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:170)
        at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2389)
        at java.base/java.lang.Runtime.load0(Runtime.java:751)
        at java.base/java.lang.System.load(System.java:1912)
        at org.jetbrains.skiko.Library.loadLibraryOrCopy(Library.kt:20)
        at org.jetbrains.skiko.Library.findAndLoad(Library.kt:113)
        at org.jetbrains.skiko.Library.load(Library.kt:59)
        at org.jetbrains.skia.impl.Library$Companion.staticLoad(Library.jvm.kt:12)
        at androidx.compose.ui.ConfigureSwingGlobalsForCompose_desktopKt.configureSwingGlobalsForCompose(ConfigureSwingGlobalsForCompose.desktop.kt:49)
        at androidx.compose.ui.ConfigureSwingGlobalsForCompose_desktopKt.configureSwingGlobalsForCompose$default(ConfigureSwingGlobalsForCompose.desktop.kt:38)
        at androidx.compose.ui.window.Application_desktopKt.application(Application.desktop.kt:110)
        at androidx.compose.ui.window.Application_desktopKt.application$default(Application.desktop.kt:105)
        at MainKt.main(main.kt:4)
        at MainKt.main(main.kt)

> Task :desktopApp:run FAILED

FAILURE: Build failed with an exception.

Additional context Nothing

romanovj commented 1 year ago

What do you have here?

patchelf --print-rpath /data/data/com.termux/files/home/.skiko/664c862db42629565e1dd3eaaf7b5b1452f4b8472a7769a15f7e6b981ca36e1a/libskiko-linux-arm64.so

ghost commented 1 year ago

What do you have here?

patchelf --print-rpath /data/data/com.termux/files/home/.skiko/664c862db42629565e1dd3eaaf7b5b1452f4b8472a7769a15f7e6b981ca36e1a/libskiko-linux-arm64.so

It is returning an empty line

romanovj commented 1 year ago

try to set rpath

patchelf --set-rpath /data/data/com.termux/files/usr/lib /data/data/com.termux/files/home/.skiko/664c862db42629565e1dd3eaaf7b5b1452f4b8472a7769a15f7e6b981ca36e1a/libskiko-linux-arm64.so

ghost commented 1 year ago

try to set rpath

patchelf --set-rpath /data/data/com.termux/files/usr/lib /data/data/com.termux/files/home/.skiko/664c862db42629565e1dd3eaaf7b5b1452f4b8472a7769a15f7e6b981ca36e1a/libskiko-linux-arm64.so

Yeah that worked and the libGL error was gone but I got new error which is related to glibc, since termux does not support glibc, I can't run my app on termux but in proot I can run, so initially my problem was resolved nor be fixable. Thanks for helping me .

romanovj commented 1 year ago

you can (in theory) https://github.com/termux-pacman/glibc-packages

ghost commented 1 year ago

you can (in theory) https://github.com/termux-pacman/glibc-packages

I tried it but no success

ghost commented 1 year ago

I replaced usr/lib with glibc/lib in patchelf and copied libGL and then also it won't run and crashed

okushnikov commented 4 months ago

Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.