flet icon indicating copy to clipboard operation
flet copied to clipboard

Flet app startup issue in Windows Build

Open wpritom opened this issue 1 year ago • 7 comments

Inconsistent performance in Windows build has been observed. There are 3 scenarios after running the executable file.

  1. UI Loads instantly
  2. UI loads after a waiting for a few seconds
  3. UI does not load even after 10 seconds. (seems like app has been crashed)

There is no way to sense the reason behind this behavior. This happens for as simple code as following:

import datetime
import flet as ft

def notify_user(e):
   pass
    
async def main(page: ft.Page):

    tool_column = ft.Column([ft.Text("HELLO")])

    page.add(
        tool_column
        )

ft.app(main)

The app is build with the following command.

flet build windows --project sample--module-name app.py --output build --verbose

OS : Windows 11 Python: 3.12.4 Flet: 0.23.2 Flutter: 3.22.3

The build is also tested in other desktops. The behavior was same.

wpritom avatar Jul 30 '24 04:07 wpritom

the same issue! UI loading very slower

suifeng2018 avatar Aug 05 '24 16:08 suifeng2018

It also happening with me. UI not refresh automatically.

imadityacoder avatar Aug 08 '24 13:08 imadityacoder

Will you guys mind sharing a screen record?

ndonkoHenri avatar Aug 08 '24 15:08 ndonkoHenri

Sounds like the issue i faced in

  • https://github.com/flet-dev/flet/issues/3738

Will you guys mind sharing a screen record?

I shared a screen record

baseplate-admin avatar Aug 08 '24 15:08 baseplate-admin

I observe the same situation. In demonstrating this problem, the program was build using "flet build windows" command, there were no errors during assembly, the code was taken from the example.

https://github.com/user-attachments/assets/2714be92-4d20-4f74-b6fa-d7005266d146

VordyV avatar Oct 04 '24 18:10 VordyV

This problem still remains in the latest version (0.24.0).

wpritom avatar Oct 05 '24 03:10 wpritom

It is also happening in android

https://github.com/user-attachments/assets/b2eb70de-382d-44b1-8e35-56bee07642f0.mp4

imadityacoder avatar Oct 10 '24 02:10 imadityacoder

Same to me @ndonkoHenri

I have same issue. Sometimes app starting properly, but almost all time its just white/black screen.

Wanna-Pizza avatar Dec 06 '24 16:12 Wanna-Pizza

I have the same issue on windows with flet v0.25.1

baebranch avatar Jan 05 '25 14:01 baebranch

It is also happening in android

https://github.com/user-attachments/assets/b2eb70de-382d-44b1-8e35-56bee07642f0.mp4

Did you remove splash screen

tinyabdu avatar Jan 06 '25 00:01 tinyabdu

Possibly related issue for regular execution/start in Windows (Windows 10, Python 32 Bit, Python 3.10.11).

  • no influence by Windows Defender
  • no influence by Windows Firewall
  • no influence with fresh Python Installation

Very slow execution (~10..12s) in case of: import flet (even for simple applications) or "flet --version" command on commandline

Random manual interruption will lead to C:\env\Python310-32\lib\site-packages\flet\core\icons.py, which therefore consumes A LOT of processing time. in our case.

Update: if strongly reducing the number of icons in core\icons.py (from ~17000ish to a few), start time decreases strongly (as one would expect). Maybe flet needs another definition of item handling/loading or create precompiled structures for this case. Startup can be reduced to 0.5s.

The issue started (in our case) with an update to newest version, and was not observed previously. Revert to older versions did not help.

C:\Users\PRODAT>flet --version Traceback (most recent call last): File "C:\env\Python310-32\lib\runpy.py", line 196, in _run_module_as_main return run_code(code, main_globals, None, File "C:\env\Python310-32\lib\runpy.py", line 86, in run_code exec(code, run_globals) File "C:\env\Python310-32\Scripts\flet.exe_main.py", line 4, in File "C:\env\Python310-32\lib\site-packages\flet_init.py", line 1, in from flet.app import app, app_async File "C:\env\Python310-32\lib\site-packages\flet\app.py", line 12, in from flet.core.page import Page File "C:\env\Python310-32\lib\site-packages\flet\core\page.py", line 32, in from flet.core.adaptive_control import AdaptiveControl File "C:\env\Python310-32\lib\site-packages\flet\core\adaptive_control.py", line 3, in from flet.core.control import Control File "C:\env\Python310-32\lib\site-packages\flet\core\control.py", line 18, in from flet.core.badge import Badge, BadgeValue File "C:\env\Python310-32\lib\site-packages\flet\core\badge.py", line 5, in from flet.core.text_style import TextStyle File "C:\env\Python310-32\lib\site-packages\flet\core\text_style.py", line 5, in from flet.core.box import BoxShadow File "C:\env\Python310-32\lib\site-packages\flet\core\box.py", line 6, in from flet.core.border import Border File "C:\env\Python310-32\lib\site-packages\flet\core\border.py", line 5, in from flet.core.types import ColorValue, OptionalNumber File "C:\env\Python310-32\lib\site-packages\flet\core\types.py", line 28, in from flet.core.icons import Icons, icons File "C:\env\Python310-32\lib\site-packages\flet\core\icons.py", line 29, in class icons(str, Enum, metaclass=IconsDeprecated): File "C:\env\Python310-32\lib\enum.py", line 302, in new if canonical_member.value == enum_member.value: KeyboardInterrupt ^C C:\Users\PRODAT>flet --version Traceback (most recent call last): File "C:\env\Python310-32\lib\runpy.py", line 196, in _run_module_as_main return run_code(code, main_globals, None, File "C:\env\Python310-32\lib\runpy.py", line 86, in run_code exec(code, run_globals) File "C:\env\Python310-32\Scripts\flet.exe_main.py", line 4, in File "C:\env\Python310-32\lib\site-packages\flet_init.py", line 1, in from flet.app import app, app_async File "C:\env\Python310-32\lib\site-packages\flet\app.py", line 12, in from flet.core.page import Page File "C:\env\Python310-32\lib\site-packages\flet\core\page.py", line 32, in from flet.core.adaptive_control import AdaptiveControl File "C:\env\Python310-32\lib\site-packages\flet\core\adaptive_control.py", line 3, in from flet.core.control import Control File "C:\env\Python310-32\lib\site-packages\flet\core\control.py", line 18, in from flet.core.badge import Badge, BadgeValue File "C:\env\Python310-32\lib\site-packages\flet\core\badge.py", line 5, in from flet.core.text_style import TextStyle File "C:\env\Python310-32\lib\site-packages\flet\core\text_style.py", line 5, in from flet.core.box import BoxShadow File "C:\env\Python310-32\lib\site-packages\flet\core\box.py", line 6, in from flet.core.border import Border File "C:\env\Python310-32\lib\site-packages\flet\core\border.py", line 5, in from flet.core.types import ColorValue, OptionalNumber File "C:\env\Python310-32\lib\site-packages\flet\core\types.py", line 28, in from flet.core.icons import Icons, icons File "C:\env\Python310-32\lib\site-packages\flet\core\icons.py", line 29, in class icons(str, Enum, metaclass=IconsDeprecated): File "C:\env\Python310-32\lib\enum.py", line 302, in new if canonical_member.value == enum_member.value: KeyboardInterrupt ^C C:\Users\PRODAT>flet --version Traceback (most recent call last): File "C:\env\Python310-32\lib\runpy.py", line 196, in _run_module_as_main return run_code(code, main_globals, None, File "C:\env\Python310-32\lib\runpy.py", line 86, in run_code exec(code, run_globals) File "C:\env\Python310-32\Scripts\flet.exe_main.py", line 4, in File "C:\env\Python310-32\lib\site-packages\flet_init.py", line 1, in from flet.app import app, app_async File "C:\env\Python310-32\lib\site-packages\flet\app.py", line 12, in from flet.core.page import Page File "C:\env\Python310-32\lib\site-packages\flet\core\page.py", line 32, in from flet.core.adaptive_control import AdaptiveControl File "C:\env\Python310-32\lib\site-packages\flet\core\adaptive_control.py", line 3, in from flet.core.control import Control File "C:\env\Python310-32\lib\site-packages\flet\core\control.py", line 18, in from flet.core.badge import Badge, BadgeValue File "C:\env\Python310-32\lib\site-packages\flet\core\badge.py", line 5, in from flet.core.text_style import TextStyle File "C:\env\Python310-32\lib\site-packages\flet\core\text_style.py", line 5, in from flet.core.box import BoxShadow File "C:\env\Python310-32\lib\site-packages\flet\core\box.py", line 6, in from flet.core.border import Border File "C:\env\Python310-32\lib\site-packages\flet\core\border.py", line 5, in from flet.core.types import ColorValue, OptionalNumber File "C:\env\Python310-32\lib\site-packages\flet\core\types.py", line 28, in from flet.core.icons import Icons, icons File "C:\env\Python310-32\lib\site-packages\flet\core\icons.py", line 29, in class icons(str, Enum, metaclass=IconsDeprecated): File "C:\env\Python310-32\lib\enum.py", line 302, in new if canonical_member.value == enum_member.value: KeyboardInterrupt ^C

2dig4it avatar Jan 08 '25 10:01 2dig4it

App startup on Windows has been improved.

FeodorFitsner avatar Mar 11 '25 19:03 FeodorFitsner