FileKit icon indicating copy to clipboard operation
FileKit copied to clipboard

File picker doesn't work on linux

Open kroune opened this issue 11 months ago • 8 comments

When using file picker on linux (I have used sample compose project) it spams with errors and doesn't work

image

`(java:140182): Gtk-WARNING **: 00:04:56.728: drawing failure for widget 'GtkViewport': error occurred in libfreetype

(java:140182): Gtk-WARNING **: 00:04:56.728: drawing failure for widget 'GtkPlacesSidebar': error occurred in libfreetype

(java:140182): Gtk-WARNING **: 00:04:56.728: drawing failure for widget 'GtkPaned': error occurred in libfreetype

(java:140182): Gtk-WARNING **: 00:04:56.728: drawing failure for widget 'GtkBox': error occurred in libfreetype

(java:140182): Gtk-WARNING **: 00:04:56.728: drawing failure for widget 'GtkFileChooserWidget': error occurred in libfreetype

(java:140182): Gtk-WARNING **: 00:04:56.728: drawing failure for widget 'GtkBox': error occurred in libfreetype

(java:140182): Gtk-WARNING **: 00:04:56.728: drawing failure for widget 'GtkFileChooserDialog': error occurred in libfreetype `

System info: Arch linux File manager: Thunar

kroune avatar Dec 26 '24 21:12 kroune

Hi @kroune! Thanks for sharing this issue!

I found this related issue: https://youtrack.jetbrains.com/issue/CMP-6022

I will probably need some help to solve this one, it seems not trivial.

vinceglb avatar Dec 30 '24 18:12 vinceglb

funny I just got this issue today, but didn't have it lastnight. and I didn't update my linux or any file related code. I did however update some libraries in my gradle file. I also did a git push lastnight when it was working. I'll see if I can find the change.

ok I'm no linux expert, so ignore this if Im way off. my issue went away after making sure the includes I used were desktop and not android. and adding this

-keep class com.sun.jna.** { ; } -keep class * implements com.sun.jna.* { *; }

to my proguard rules.

sorry if this does not apply.

Duron27 avatar Apr 18 '25 01:04 Duron27

@kroune, does this solve your problem if you put this in your proguard file?

-keep class com.sun.jna.** { ; } -keep class * implements com.sun.jna.* { *; }

vinceglb avatar May 02 '25 16:05 vinceglb

@kroune, does this solve your problem if you put this in your proguard file?

-keep class com.sun.jna.** { ; } -keep class * implements com.sun.jna.* { *; }

no, it doesn't help, it doesn't work even if I use runDistributable (which doesn't have proguard at all)

Image

kroune avatar May 12 '25 00:05 kroune

After playing around with it I found that some elements are visible (sometimes) and it seems like it works a bit (but ui is still completely fucked)

Image

Also I think it would be nice to have another implementation of a file picker as a workaround

kroune avatar May 12 '25 01:05 kroune

Just FYI, we're having a similar problem with the Processing project on Linux. If we sort it out I'll let you know. https://github.com/processing/processing4/issues/1147 (In our case we have a workaround, which is using the Java file picker instead of the native Linux OS one.)

joshgiesbrecht avatar Jul 04 '25 18:07 joshgiesbrecht

@kroune, does this solve your problem if you put this in your proguard file?

-keep class com.sun.jna.** { ; } -keep class * implements com.sun.jna.* { *; }

These rules solved a crash I had on my application on MacOS. This information should be added to the documentation

nicopico-dev avatar Aug 28 '25 21:08 nicopico-dev

@nicopico-dev I updated the JVM setup documentation with a proguard section ✅

https://filekit.mintlify.app/core/setup#proguard-configuration

vinceglb avatar Sep 06 '25 23:09 vinceglb