I am building an Android application using the Flet framework in Python. I am trying to customize the splash screen logo and the app icon, but after building the APK, the app still shows the default Flet logo for both the splash screen and the icon.

I have tried using AI assistants to debug the issue, but the suggestions provided haven't worked so far. I am concerned if there are specific requirements for the .png format or if there are certain limitations in the Flet build process regarding asset support.

My environment:

Framework: Flet (Python)

Target: Android (APK)

Build Tool: flet build apk

What I have tried:

Placing the logo in the assets folder.

Checking if the file path is correct in my code/configuration.

Verifying the .png file is not corrupted.

My Question: What is the correct way to specify a custom logo for the splash screen and the app icon when building a Flet app for Android? Are there specific file naming conventions or directory structures I should follow?

Kushner Akiva's user avatar

New contributor

Kushner Akiva is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

1

I just came across this exact issue today, so i did alot of nuclear fixes after research. your pyproject.toml should have this:
Also you need to have the pictures named accordingly. For the splash and icon, theres hidden flet defaults, so delete them on occurence. All images should be named exactly as seen below.

Hope this helps!

[tool.flet.icons] android = "assets/icon.png" #should be structured exactly like these splash_android = "assets/splash_android.png" #rename your splash image accordingly splash_android_dark = "assets/splash_android_dark.png" [tool.flet.splash] color = "#ffffff" # change to match your app background color dark_color = "#ffffff" # change to match your dark mode background color android_gravity = "fill" # position of splash image: center, fill, etc. hide_animation = true # hides the Flet spinner/logo during Python startup

Davies Oluwatobiloba Daniel's user avatar

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.