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.61k stars 455 forks source link

flet build - No file or variants found for asset: app/app.zip.hash #2507

Open przybjul opened 10 months ago

przybjul commented 10 months ago

Description I wanted to publish static website, I succeeded using this command: flet publish . However flet build web command caused an error: No file or variants found for asset: app/app.zip.hash - I checked that app folder was generated. Could it be problem with hash decoding?

Folder tree:

image

Flet version (pip show flet):

Name: flet
Version: 0.18.0
Summary: Flet for Python - easily build interactive multi-platform apps in Python
Home-page: 
Author: Appveyor Systems Inc.
Author-email: hello@flet.dev
License: Apache-2.0
Location: /home/przybjul/R2D2-middleware/R2D2-middleware/r2d2_robot_tests/lib/python3.11/site-packages
Requires: cookiecutter, flet-runtime, packaging, qrcode, watchdog, websocket-client, websockets
Required-by: flet-fastapi

Operating system: Windows

Additional environment details: using wsl2

Error code: OK Packaging Python app...Building package executable... (1.8s) Built serious_python:main. Running package command Creating asset directory: /tmp/flet_flutter_build_nmKOmkDfke/app Copying Python app from /home/przybjul/R2D2-middleware/R2D2-middleware/r2d2_robot_tests/flet_app to /tmp/serious_python_tempYPNSPH Configured emscripten_3_1_45_wasm32 platform with sitecustomize.py at /tmp/serious_python_sitecustomizeRGASGD/sitecustomize.py Installing 'find-links' dependencies [micropip] with pip command to /tmp/serious_python_tempYPNSPH/pypackages Extracting Python distributive from /tmp/cpython-3.11.6+20231002-x86_64-unknown-linux-gnu-install_only.tar.gz to /tmp/hostpython3.11_QAIRDJ Installing dependencies [pyyaml, flet-pyodide] with pip command to /tmp/serious_python_tempYPNSPH/pypackages Compiling Python sources at /tmp/serious_python_tempYPNSPH Delete unnecessary files with extensions: [.py, .c, .h, .typed, .exe, .a, .pdb, .pyd, .dll] Delete unnecessary files and directories: [pycache, bin] Creating app archive at /tmp/flet_flutter_build_nmKOmkDfke/app/app.zip from /tmp/serious_python_tempYPNSPH Deleting temp directory /tmp/serious_python_tempYPNSPH Deleting sitecustomize directory /tmp/serious_python_sitecustomizeRGASGD Deleting Python directory /tmp/hostpython3.11_QAIRDJ OK Building web app...['/snap/bin/flutter', 'build', 'web'] Resolving dependencies... ffi 2.1.0 (2.1.2 available) fl_chart 0.65.0 (0.66.1 available) flutter_lints 2.0.3 (3.0.1 available) flutter_native_splash 2.3.7 (2.3.10 available) js 0.6.7 (0.7.0 available) lints 2.1.1 (3.0.0 available) matcher 0.12.16 (0.12.16+1 available) material_color_utilities 0.5.0 (0.8.0 available) meta 1.10.0 (1.11.0 available) package_info_plus 4.2.0 (5.0.1 available) path 1.8.3 (1.9.0 available) petitparser 5.4.0 (6.0.2 available) test_api 0.6.1 (0.7.0 available) toml 0.14.0 (0.15.0 available) web 0.3.0 (0.4.2 available) web_socket_channel 2.4.0 (2.4.3 available) xml 6.3.0 (6.5.0 available) Got dependencies! 17 packages have newer versions incompatible with dependency constraints. Try flutter pub outdated for more information.

Error detected in pubspec.yaml: No file or variants found for asset: app/app.zip.hash.

Target web_release_bundle failed: Exception: Failed to bundle asset files.

0 copyAssets (package:flutter_tools/src/build_system/targets/assets.dart:63:5)

#1 WebReleaseBundle.build (package:flutter_tools/src/build_system/targets/web.dart:401:29) #2 _BuildInstance._invokeInternal (package:flutter_tools/src/build_system/build_system.dart:853:9) #3 Future.wait. (dart:async/future.dart:523:21) #4 _BuildInstance.invokeTarget (package:flutter_tools/src/build_system/build_system.dart:791:32) #5 FlutterBuildSystem.build (package:flutter_tools/src/build_system/build_system.dart:620:16) #6 WebBuilder.buildWeb (package:flutter_tools/src/web/compile.dart:89:34) #7 BuildWebCommand.runCommand (package:flutter_tools/src/commands/build_web.dart:199:5) #8 FlutterCommand.run. (package:flutter_tools/src/runner/flutter_command.dart:1367:27) #9 AppContext.run. (package:flutter_tools/src/base/context.dart:150:19) #10 CommandRunner.runCommand (package:args/command_runner.dart:212:13) #11 FlutterCommandRunner.runCommand. (package:flutter_tools/src/runner/flutter_command_runner.dart:348:9) #12 AppContext.run. (package:flutter_tools/src/base/context.dart:150:19) #13 FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:294:5) #14 run.. (package:flutter_tools/runner.dart:112:9) #15 AppContext.run. (package:flutter_tools/src/base/context.dart:150:19) #16 main (package:flutter_tools/executable.dart:90:3) Compiling lib/main.dart for the Web... 49.6s Exception: Failed to compile application for the Web. Deleting Flutter bootstrap directory /tmp/flet_flutter_build_nmKOmkDfke Error building Flet app - see the log of failed command above.
ndonkoHenri commented 10 months ago

It is mentioned in the docs not to install Flutter with snap. But looking at the logs, seems like you make use of it... it might be the cause.

przybjul commented 10 months ago

It is mentioned in the docs not to install Flutter with snap. But looking at the logs, seems like you make use of it... it might be the cause.

I reinstalled flutter without snap, but still I have the same Error: flet build web Creating Flutter bootstrap project...OK Customizing app icons and splash images...OK Generating app icons...OK Generating splash screens...OK Packaging Python app...OK Building web app...Found an existing Pub cache at /home/przybjul/.pub-cache. It can be repaired by running dart pub cache repair. It can be reset by running dart pub cache clean. Resolving dependencies... ffi 2.1.0 (2.1.2 available) fl_chart 0.65.0 (0.66.1 available) flutter_lints 2.0.3 (3.0.1 available) flutter_native_splash 2.3.7 (2.3.10 available) js 0.6.7 (0.7.0 available) lints 2.1.1 (3.0.0 available) matcher 0.12.16 (0.12.16+1 available) material_color_utilities 0.5.0 (0.8.0 available) meta 1.10.0 (1.11.0 available) package_info_plus 4.2.0 (5.0.1 available) path 1.8.3 (1.9.0 available) petitparser 5.4.0 (6.0.2 available) test_api 0.6.1 (0.7.0 available) toml 0.14.0 (0.15.0 available) web 0.3.0 (0.4.2 available) web_socket_channel 2.4.0 (2.4.3 available) xml 6.3.0 (6.5.0 available) Got dependencies! 17 packages have newer versions incompatible with dependency constraints. Try flutter pub outdated for more information.

Compiling lib/main.dart for the Web... Error detected in pubspec.yaml: Compiling lib/main.dart for the Web... 41.0s

No file or variants found for asset: app/app.zip.hash.

Target web_release_bundle failed: Exception: Failed to bundle asset files.

0 copyAssets (package:flutter_tools/src/build_system/targets/assets.dart:63:5)

#1 WebReleaseBundle.build (package:flutter_tools/src/build_system/targets/web.dart:401:29) #2 _BuildInstance._invokeInternal (package:flutter_tools/src/build_system/build_system.dart:853:9) #3 Future.wait. (dart:async/future.dart:523:21) #4 _BuildInstance.invokeTarget (package:flutter_tools/src/build_system/build_system.dart:791:32) #5 FlutterBuildSystem.build (package:flutter_tools/src/build_system/build_system.dart:620:16) #6 WebBuilder.buildWeb (package:flutter_tools/src/web/compile.dart:89:34) #7 BuildWebCommand.runCommand (package:flutter_tools/src/commands/build_web.dart:199:5) #8 FlutterCommand.run. (package:flutter_tools/src/runner/flutter_command.dart:1367:27) #9 AppContext.run. (package:flutter_tools/src/base/context.dart:150:19) #10 CommandRunner.runCommand (package:args/command_runner.dart:212:13) #11 FlutterCommandRunner.runCommand. (package:flutter_tools/src/runner/flutter_command_runner.dart:348:9) #12 AppContext.run. (package:flutter_tools/src/base/context.dart:150:19) #13 FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:294:5) #14 run.. (package:flutter_tools/runner.dart:112:9) #15 AppContext.run. (package:flutter_tools/src/base/context.dart:150:19) #16 main (package:flutter_tools/executable.dart:90:3) Exception: Failed to compile application for the Web. Error building Flet app - see the log of failed command above.
ndonkoHenri commented 1 day ago

Please give the latest Flet version a try.