flet icon indicating copy to clipboard operation
flet copied to clipboard

Windows build fails

Open Bbalduzz opened this issue 6 months ago • 1 comments

Description

Using the command flet build windows fails and returns this "error":

PS E:\projects\slidesgrabber> flet build windows
Creating Flutter bootstrap project...OK
Customizing app icons and splash images...OK
Generating app icons...OK
Packaging Python app...Running package command
Creating asset directory: C:\Users\edoar\AppData\Local\Temp\flet_flutter_build_CVSiTUVYwp\app
Copying Python app from E:\vscode_projects\slidesgrabber to C:\Users\edoar\AppData\Local\Temp\serious_python_temp2e039a58
Installing dependencies  with pip command to C:\Users\edoar\AppData\Local\Temp\serious_python_temp2e039a58\__pypackages__
Extracting Python distributive from C:\Users\edoar\AppData\Local\Temp\cpython-3.11.6+20231002-x86_64-pc-windows-msvc-shared-install_only.tar.gz to C:\Users\edoar\AppData\Local\Temp\hostpython3.11_ee5dae7e
Compiling Python sources at C:\Users\edoar\AppData\Local\Temp\serious_python_temp2e039a58

Error building Flet app - see the log of failed command above.

The issue is that with the minimum reproducible example provided in the flet.dev docs, everything works just fine.

Flet version: 0.20.2 Operating system: windows 10 My requirements.txt file

flet
fitz
pytesseract
scipy
pyautogui
numpy

Bbalduzz avatar Feb 21 '24 08:02 Bbalduzz

Have the similar situation, with my project. Flet version: 0.21.2 Operating system: windows 11

Compiling 'C:\\Users\\sa090\\AppData\\Local\\Temp\\serious_python_temp2a5dafec\\views\\zipparts_view.py'... Deleting Flutter bootstrap directory C:\Users\sa090\AppData\Local\Temp\flet_flutter_build_HrjhsnPRh2 Error building Flet app - see the log of failed command above.

Does anyone know how to resolve?

MusienkoAnton avatar Apr 04 '24 15:04 MusienkoAnton

(.venv) PS C:\Users\nacho\qr-app> flet build windows .\flet-qr-app\
Creating Flutter bootstrap project from gh:flet-dev/flet-build-template with ref 0.22.1...OK
Customizing app icons and splash images...OK
Generating app icons...OK
Packaging Python app...Running package command
Creating asset directory: C:\Users\nacho\AppData\Local\Temp\flet_flutter_build_4XvQZTMX7c\app
Copying Python app from C:\Users\nacho\qr-app\flet-qr-app to C:\Users\nacho\AppData\Local\Temp\serious_python_temp351b0dfc
Installing dependencies  with pip command to C:\Users\nacho\AppData\Local\Temp\serious_python_temp351b0dfc\__pypackages__
Extracting Python distributive from C:\Users\nacho\AppData\Local\Temp\cpython-3.11.6+20231002-x86_64-pc-windows-msvc-shared-install_only.tar.gz to C:\Users\nacho\AppData\Local\Temp\hostpython3.11_9a8206a7
Compiling Python sources at C:\Users\nacho\AppData\Local\Temp\serious_python_temp351b0dfc

Error building Flet app - see the log of failed command above.

I also got this error. Anyone knows?

nachomf18 avatar May 10 '24 12:05 nachomf18

(.venv) PS C:\Users\nacho\qr-app> flet build windows .\flet-qr-app\
Creating Flutter bootstrap project from gh:flet-dev/flet-build-template with ref 0.22.1...OK
Customizing app icons and splash images...OK
Generating app icons...OK
Packaging Python app...Running package command
Creating asset directory: C:\Users\nacho\AppData\Local\Temp\flet_flutter_build_4XvQZTMX7c\app
Copying Python app from C:\Users\nacho\qr-app\flet-qr-app to C:\Users\nacho\AppData\Local\Temp\serious_python_temp351b0dfc
Installing dependencies  with pip command to C:\Users\nacho\AppData\Local\Temp\serious_python_temp351b0dfc\__pypackages__
Extracting Python distributive from C:\Users\nacho\AppData\Local\Temp\cpython-3.11.6+20231002-x86_64-pc-windows-msvc-shared-install_only.tar.gz to C:\Users\nacho\AppData\Local\Temp\hostpython3.11_9a8206a7
Compiling Python sources at C:\Users\nacho\AppData\Local\Temp\serious_python_temp351b0dfc

Error building Flet app - see the log of failed command above.

I also got this error. Anyone knows?

I try to update Python, than try to use different versions of Flet, also try to make simple project also get this error

MusienkoAnton avatar May 10 '24 14:05 MusienkoAnton

Command "flet build apk --module-name"

I'm experiencing the same error "Error building Flet app - see the log of failed command above". The funny thing is that yesterday there was success and today there is failure.

Python Version 3.12.2 flet==0.22.0 flet-core==0.22.0 flet-runtime==0.22.0

goncaze avatar May 12 '24 14:05 goncaze

The solution to my problem involved identifying the point of failure. The flet does not seem to make it easier to identify this type of failure. I had to do it line by line, command by command.

I identified the point of failure that caused the alert "Error building Flet app - see the log of failed command above". In a class that inherits from ft.View there were some print commands with f-string. The APK was generated successfully after removing these print commands.

Could this also be related to your problem?

goncaze avatar May 12 '24 23:05 goncaze