flet-dev / flet

Flet enables developers to easily build realtime web, mobile and desktop apps in Python. No frontend experience required.
https://flet.dev
Apache License 2.0
11.5k stars 449 forks source link

flet==0.25.0.dev3526 "Android" Apk does not show the application icon, it shows a black image #4201

Closed jtoror closed 1 month ago

jtoror commented 1 month ago

Duplicate Check

Describe the bug

flet==0.25.0.dev3526 "Android" Apk does not show the application icon, it shows a black image, both on physical and virtual devices.

Code sample

Code ```python [project] name = "amy_app" version = "1.0.0" description = "My first Flet project" authors = [ {name = "John Smith", email = "john@email.com"} ] dependencies = [ "flet==0.25.0.dev3526" ] # requires-python = ">=3.12" icon = "assets/icon" [tool.flet.android.permission] # --android-permissions "android.permission.INTERNET" = true "android.permission.CAMERA" = true "android.permission.READ_EXTERNAL_STORAGE" = true "android.permission.WRITE_EXTERNAL_STORAGE" = true "android.permission.READ_MEDIA_VISUAL_USER_SELECTED" = true main.py import os import flet as ft def main(page: ft.Page): page.title = "Flet counter example" page.vertical_alignment = ft.MainAxisAlignment.CENTER txt_number = ft.TextField( value="0", text_align=ft.TextAlign.RIGHT, width=100) def minus_click(e): txt_number.value = str(int(txt_number.value) - 1) page.update() def plus_click(e): txt_number.value = str(int(txt_number.value) + 1) page.update() page.add( ft.Row( [ ft.IconButton(ft.icons.REMOVE, on_click=minus_click), txt_number, ft.IconButton(ft.icons.ADD, on_click=plus_click), ], alignment=ft.MainAxisAlignment.CENTER, ) ) ft.app(main) ```

To reproduce

flet build apk

Expected behavior

No response

Screenshots / Videos

Captures ![image](https://github.com/user-attachments/assets/8dd6f466-aa60-4113-b0d3-e6c0a6215154)

Operating System

Linux

Operating system details

Kubuntu 24.04

Flet version

0.25.0.dev3526

Regression

No, it isn't

Suggestions

No response

Logs

Logs ```console [Paste your logs here] ```

Additional details

No response

FeodorFitsner commented 1 month ago

What kind of image do you use for the icon and does it exist in assets folder?

jtoror commented 1 month ago

What kind of image do you use for the icon and does it exist in assets folder?

I compiled it several times changing parameters and dependencies because of the other problems it causes me, but I used the one that comes by default in the counter demo. I also tested it using an icon.ico placing it in the assent folder and in the main root but it still remains black. It is like this for the physical and virtual device.

FeodorFitsner commented 1 month ago

Solved.

Configure color for adaptive background on Android.

In pyproject.toml:

[tool.flet.android]
adaptive_icon_background = "#ffffff" # your color

or use --android-adaptive-icon-background CLI option.