Skip to main content
FileKit Dialogs opens native file, folder, gallery, and save dialogs and returns the result as a PlatformFile. Most targets need no setup beyond the dependency.

Installation

FileKit can helps you to display dialogs to the user like file, directory and photo pickers, save dialogs, camera and more. FileKit dialogs are available in two flavors:
Both artifacts include filekit-core. Check the platform support matrix for the dialogs available on each target.

Android setup

Only Android needs an init step for dialogs, and only when you call the suspend APIs (FileKit.openFilePicker()…). Compose launchers register the activity for you, but a suspend call made before any launcher is composed throws FileKitNotInitializedException. Register your activity so FileKit can reach its ActivityResultRegistry:
MainActivity.kt
With filekit-dialogs-compose, the launchers find the registry themselves. On JVM, Linux native, and Windows native, FileKit.init(appId) is not needed for dialogs: it only configures app directories such as filesDir and cacheDir. See Core setup.

Linux setup

Packaged Compose Desktop apps need the jdk.security.auth module, otherwise dialogs can fail with a NoClassDefFoundError (issue #107):
build.gradle.kts
Dialogs use the XDG Desktop Portal when it is running and fall back to AWT/Swing dialogs otherwise.

Compose launchers

remember…Launcher functions capture platform context when they are remembered, not when you call launch(). A few platforms care about where that happens.
main.kt

ProGuard

If you shrink or obfuscate your JVM app, add the JNA and D-Bus keep rules from Core setup.