Skip to content

FilePicker.save_file() opens blank gray screen in APK build (works fine in VS) #5301

@kamaciki

Description

@kamaciki

I’m using Flet v0.28.2 to build a simple file picker UI. In Visual Studio debugging everything works as expected, including the “Save” button. However, when I compile the app to APK and install it on an Android device, tapping the “Save” button causes a blank gray screen to open instead of showing the save dialog. The “Pick” and “Get Dir” buttons both work correctly in the APK build.

Reproduction steps:

Create a new Flet app with the following code:

import flet as ft

def main(page: ft.Page):
    page.theme_mode = "light"

    def result(e):
        page.add(ft.Text("result :)"))

    my_dialog = ft.FilePicker(on_result=result)

    page.overlay.append(my_dialog)

    page.add(
        ft.Row([
            ft.ElevatedButton("Pick", icon=ft.Icons.UPLOAD_FILE,
                              on_click=lambda _: my_dialog.pick_files()),
            ft.ElevatedButton("Save", icon=ft.Icons.UPLOAD_FILE,
                              on_click=lambda _: my_dialog.save_file()),
            ft.ElevatedButton("Get Dir", icon=ft.Icons.UPLOAD_FILE,
                              on_click=lambda _: my_dialog.get_directory_path()),
        ])
    )

ft.app(target=main)

Run the app in Visual Studio (debug or “Run”) – all three buttons (pick_files(), save_file(), get_directory_path()) open their respective dialogs correctly.

Build an APK (flet pack apk or equivalent) and install it on an Android device.

Launch the app on the device and tap Save.

Actual behavior:

Visual Studio (desktop/web): “Save” opens the native file-save dialog as expected.

APK on Android: Tapping Save results in a full-screen blank gray overlay. No file dialog appears, and no error is logged.

Expected behavior:

The file-save dialog (native or Flet-provided) should appear on Android, allowing the user to choose a location and enter a filename, then trigger the on_result callback.

Environment:

Flet version: 0.28.2

Python version: 3.13

Build tool: flet build apk

Development OS: Windows 11

Additional information:

The “Pick” (pick_files()) and “Get Dir” (get_directory_path()) functions work without issue in the APK build.

No errors or warnings appear in adb logcat when tapping Save.

Other dialog types (e.g., AlertDialog) do work in the APK build.

Request:

Could this be a limitation or bug in the Android file-save integration? Any pointers on how to diagnose or work around this behavior in the APK? Thanks!

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions