APK shows white screen (builds after December 2024)
Body:
- APK built in December 2024 with flet 0.28.3 works fine
- Same code rebuilt now shows white screen
- Even a simple 5-line "Hello World" app shows white screen
- Tested on same Android device
- Tried pinning flet==0.28.3, Flutter 3.29.2, ubuntu-22.04 - still white screen
This appears to be a regression in the build process.
Can you please try the latest release and let know if the issue still happens?
I built windows and Android apps with 0.80.1 and 0.80.2. Android works fine. Windows apps show white screen for as long as 5-10 seconds at the beginning .Afterwards they work fine.
Can you please try the latest release and let know if the issue still happens?
I tried the latest version (0.80.2) but still getting white screen on Android.
Details:
- Built APK successfully with
flet build apk --verbose --yes - APK installs fine on Android device
- App shows white screen indefinitely (waited 30+ seconds)
- Same code worked perfectly in December 2024 with flet 0.28.3
- Even a simple 5-line "Hello World" app shows white screen
- Old APK from December still works on the same device
Workflow used:
- ubuntu-latest
- python 3.11
- java 17 (temurin)
- pip install flet
- flet build apk --verbose --yes
Is there anything else I can try?
I tried another one, with the simplest possible app and still getting white screen:
import flet as ft
def main(page: ft.Page):
page.title = "Moja Flet Aplikacija"
page.vertical_alignment = ft.MainAxisAlignment.CENTER
page.horizontal_alignment = ft.CrossAxisAlignment.CENTER
def promeni_tekst(e):
tekst_pozdrava.value = f"Zdravo, {polje_za_ime.value}!"
tekst_pozdrava.update()
polje_za_ime = ft.TextField(label="Unesi svoje ime", width=200)
dugme = ft.ElevatedButton(text="Klikni me", on_click=promeni_tekst)
tekst_pozdrava = ft.Text(value="Cekam unos...", size=20)
page.add(
polje_za_ime,
dugme,
tekst_pozdrava
)
ft.app(target=main)
Build environment:
- ubuntu-latest
- python 3.11
- java 17 (temurin)
- pip install flet (latest version)
- flet build apk --verbose --yes
Result:
- APK builds successfully
- APK installs on Android device
- App shows white screen indefinitely (waited 60+ seconds)
- Old APK from December 2024 (flet 0.28.3) still works perfectly on the same device
This happens with any code - even the simplest "Hello World" app shows white screen.
change a code and try again with 0.80.x.
ft.app(target=main) -> ft.run(main)
change a code and try again with 0.80.x.
ft.app(target=main) -> ft.run(main)
I tried changing ft.app(target=main) to ft.run(main) but still getting white screen.
main.py:
import flet as ft
def main(page: ft.Page):
page.title = "Moja Flet Aplikacija"
page.vertical_alignment = ft.MainAxisAlignment.CENTER
page.horizontal_alignment = ft.CrossAxisAlignment.CENTER
def promeni_tekst(e):
tekst_pozdrava.value = f"Zdravo, {polje_za_ime.value}!"
tekst_pozdrava.update()
polje_za_ime = ft.TextField(label="Unesi svoje ime", width=200)
dugme = ft.ElevatedButton(text="Klikni me", on_click=promeni_tekst)
tekst_pozdrava = ft.Text(value="Cekam unos...", size=20)
page.add(
polje_za_ime,
dugme,
tekst_pozdrava
)
ft.run(main)
requirements.txt:
flet
.github/workflows/build.yml:
name: Build Android APK
on:
workflow_dispatch:
jobs:
build-apk:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- run: pip install flet
- run: flet build apk --verbose --yes
- uses: actions/upload-artifact@v4
with:
name: apk
path: build/apk/*.apk
Result: APK builds successfully, installs on Android, but shows white screen indefinitely.
Can you connect logcat (in Android Studio or command line) to the phone/emulator and see if there are any errors/crashes?
If you still face this issue with the latest versions (>=0.85.0), please open a new ticket (with details) preferably so we can discuss and help you troubleshoot.