flet-lottie error when try to build app
Duplicate Check
- [x] I have searched the opened issues and there are no duplicates
Describe the bug
The python app can't found the flet_lottie module after upgrade from 0.25.2 to 0.26.0
I get this err
ModuleNotFoundError: No module named 'flet_lottie'`
Code sample
Code
[Paste your code here]
To reproduce
- run repo actions
- build for apk
- run on android device
Expected behavior
No response
Screenshots / Videos
Captures
[Upload media here]
Operating System
Linux
Operating system details
latest
Flet version
0.26.0
Regression
Yes, it used to work in a previous Flet version (please specify the version in additional details)
Suggestions
adding the flet_lottie to Python bundle, or packages
Logs
Logs
Traceback (most recent call last):
File "<string>", line 95, in <module>
File "<frozen runpy>", line 229, in run_module
File "<frozen runpy>", line 88, in _run_code
File "/tmp/serious_python_tempEJTEUJ/main.py", line 5, in <module>
File "/tmp/serious_python_tempEJTEUJ/lib/app.py", line 6, in <module>
File "/tmp/serious_python_tempEJTEUJ/lib/constant.py", line 9, in <module>
ModuleNotFoundError: No module named 'flet_lottie'
Additional details
Prev flet version 0.25.2
What do you have in app's pyproject.toml?
What do you have in app's
pyproject.toml?
[tool.poetry]
name = "ynet"
version = "13.0.0"
description = "Yemen Net Internet Services"
authors = ["Osama Mohammed <[email protected]>"]
readme = "README.md"
[tool.flet]
# org name in reverse domain name notation, e.g. "com.mycompany".
# Combined with project.name to build bundle ID for iOS and Android apps
org = "com.omamkaz"
# project display name that is used as an app title on Android and iOS home screens,
# shown in window titles and about app dialogs on desktop.
product = "ynet"
# company name to display in about app dialogs
company = "omamkaz"
# copyright text to display in about app dialogs
copyright = "Copyright (C) 2024 by omamkaz"
build_number = 13
dependencies = [
"flet-lottie",
"flet==0.26.0",
"bs4==0.0.2",
"requests==2.32.3",
"humanize==4.10.0",
"pydal==20241201.2"
]
[tool.flet.flutter]
build_args = ["--release", "--analyze-size", "--target-platform", "android-arm"] # android-arm64
dependencies = ["flet_lottie"]
[tool.flet.compile]
app = true
packages = true
cleanup = true
[tool.flet.android]
split_per_abi = true
build_arch = "armeabi-v7a" # arm64-v8a
adaptive_icon_background = "#003374"
[tool.flet.app]
path = "src"
exclude = ["media", "fastlane", "assets/animations", ".github", ".git"]
[tool.poetry.dependencies]
python = ">=3.10,<4"
flet = "0.26.0"
bs4 = "0.0.2"
requests = "2.32.3"
humanize = "4.10.0"
pydal = "20241201.2"
flet-lottie = "0.1.0"
[tool.poetry.group.dev.dependencies]
flet = {extras = ["all"], version = "0.26.0"}
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
Please re-build with flet build apk -v and provide the log here.
Please re-build with
flet build apk -vand provide the log here.
Run flutter doctor
╔════════════════════════════════════════════════════════════════════════════╗
║ Welcome to Flutter! - https://flutter.dev/ ║
║ ║
║ The Flutter tool uses Google Analytics to anonymously report feature usage ║
║ statistics and basic crash reports. This data is used to help improve ║
║ Flutter tools over time. ║
║ ║
║ Flutter tool analytics are not sent on the very first run. To disable ║
║ reporting, type 'flutter config --no-analytics'. To display the current ║
║ setting, type 'flutter config'. If you opt out of analytics, an opt-out ║
║ event will be sent, and then no further information will be sent by the ║
║ Flutter tool. ║
║ ║
║ By downloading the Flutter SDK, you agree to the Google Terms of Service. ║
║ The Google Privacy Policy describes how data is handled in this service. ║
║ ║
║ Moreover, Flutter includes the Dart SDK, which may send usage metrics and ║
║ crash reports to Google. ║
║ ║
║ Read about data we send with crash reports: ║
║ https://flutter.dev/to/crash-reporting ║
║ ║
║ See Google's privacy policy: ║
║ https://policies.google.com/privacy ║
║ ║
║ To disable animations in this tool, use ║
║ 'flutter config --no-cli-animations'. ║
╚════════════════════════════════════════════════════════════════════════════╝
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.27.3, on Ubuntu 24.04.1 LTS 6.8.0-1020-azure, locale C.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.1)
[✓] Chrome - develop for the web
[✓] Linux toolchain - develop for Linux desktop
[!] Android Studio (not installed)
[✓] Connected device (2 available)
[✓] Network resources
! Doctor found issues in 1 category.
Analytics reporting disabled.
You may need to restart any open editors for them to read new settings.
[18:56:51] Run subprocess:
['/opt/hostedtoolcache/flutter/stable-3.27.3-x64/bin/flutter',
'--version', '--no-version-check', '--suppress-analytics']
Flutter executable:
/opt/hostedtoolcache/flutter/stable-3.27.3-x64/bin/flutter
Dart executable:
/opt/hostedtoolcache/flutter/stable-3.27.3-x64/bin/cache/dart-sdk/bin
/dart
[18:56:52] JAVA_HOME points to a JRE. Proceeding to install JDK.
Downloading JDK from
https://github.com/adoptium/temurin17-binaries/releases/download/jdk-
17.0.13+11/OpenJDK17U-jdk_x64_linux_hotspot_17.0.13_11.tar.gz...
[18:56:53] Extracting JDK to /home/runner/java/17.0.13+11...
[18:56:56] JDK installed at /home/runner/java/17.0.13+11
Configuring Flutter's path to JDK
Run subprocess:
['/opt/hostedtoolcache/flutter/stable-3.27.3-x64/bin/flutter',
'config', '--suppress-analytics',
'--jdk-dir=/home/runner/java/17.0.13+11']
Setting "jdk-dir" value to "/home/runner/java/17.0.13+11".
You may need to restart any open editors for them to read new
settings.
JDK installed ✅
Android SDK installation found at /usr/local/lib/android/sdk
Android SDK package "cmdline-tools;latest" is already installed
Android SDK package "platform-tools" is already installed
Android SDK package "platforms;android-35" is already installed
Android SDK package "build-tools;34.0.0" is already installed
Android SDK installed ✅
Custom Flutter dependencies: {'flet_lottie': 'any'}
[18:56:57] Created Flutter bootstrap project from
gh:flet-dev/flet-build-template with ref "0.26.0" ✅
Run subprocess:
['/opt/hostedtoolcache/flutter/stable-3.27.3-x64/bin/cache/dart-sdk/b
in/dart', 'run', '--suppress-analytics', 'serious_python:main',
'package', '/home/runner/work/ynet/ynet/src', '--platform',
'Android', '--arch', 'armeabi-v7a', '--requirements',
'bs4==0.0.2,flet-lottie==0.1.0,flet==0.26.0,humanize==4.10.0,pydal==2
0241201.2,requests==2.32.3', '--exclude',
'build,media,fastlane,assets/animations,.github,.git',
'--compile-app', '--compile-packages', '--cleanup']
[18:57:04] Running package command
Extra PyPi indexes:
Creating asset directory:
/home/runner/work/ynet/ynet/build/flutter/app
Created temp directory: /tmp/serious_python_tempEJTEUJ
Copying Python app from /home/runner/work/ynet/ynet/src to a temp
directory
Compiling Python sources in a temp directory
Downloading Python distributive from
https://github.com/indygreg/python-build-standalone/releases/download
/20240909/cpython-3.12.6+20240909-x86_64-unknown-linux-gnu-install_on
ly_stripped.tar.gz to a build directory
[18:57:06] Extracting Python distributive
Cleanup app
Configured Android/armeabi-v7a platform with sitecustomize.py
Installing with pip command to
/home/runner/work/ynet/ynet/build/site-packages/armeabi-v7a
[18:57:13] Copying Flutter packages to
/home/runner/work/ynet/ynet/build/flutter-packages
Compiling app packages at
/home/runner/work/ynet/ynet/build/site-packages/armeabi-v7a
[18:57:14] Cleanup installed packages
Creating app archive at
/home/runner/work/ynet/ynet/build/flutter/app/app.zip from a temp
directory
Writing app archive hash to
/home/runner/work/ynet/ynet/build/flutter/app/app.zip.hash
Deleting temp directory
Packaged Python app ✅
Found Flutter extension at
/home/runner/work/ynet/ynet/build/flutter-packages/flet_lottie
Registered Flutter user extensions ✅
[18:57:15] Copying /home/runner/work/ynet/ynet/src/assets/icon.png to
/home/runner/work/ynet/ynet/build/flutter/images
Customized app icons and splash images ✅
Run subprocess:
['/opt/hostedtoolcache/flutter/stable-3.27.3-x64/bin/cache/dart-sdk/b
in/dart', 'run', '--suppress-analytics', 'flutter_launcher_icons']
[18:57:18] ════════════════════════════════════════════
FLUTTER LAUNCHER ICONS (v0.14.3)
════════════════════════════════════════════
• Creating default icons Android
• Overwriting the default Android launcher icon with a new icon
• Creating adaptive icons Android
• No colors.xml file found in your Android project
• Creating colors.xml file and adding it to your Android project
• Creating mipmap xml file Android
• Overwriting default iOS launcher icon with new icon
[18:57:19] Creating Icons for Web...
Creating Icons for Windows...
Creating Icons for MacOS...
[18:57:20]
✓ Successfully generated launcher icons
Generated app icons ✅
Run subprocess:
['/opt/hostedtoolcache/flutter/stable-3.27.3-x64/bin/cache/dart-sdk/b
in/dart', 'run', '--suppress-analytics',
'flutter_native_splash:create']
[18:57:22] [Android] Creating default splash images
[Android] Creating dark mode splash images
[Android] Creating default android12splash images
[Android] Creating dark mode android12splash images
[18:57:23] [Android] Updating launch background(s) with splash image path...
[Android] - android/app/src/main/res/drawable/launch_background.xml
[Android] -
android/app/src/main/res/drawable-night/launch_background.xml
[Android] -
android/app/src/main/res/drawable-v21/launch_background.xml
[Android] -
android/app/src/main/res/drawable-night-v21/launch_background.xml
[Android] Updating styles...
[Android] - android/app/src/main/res/values-v31/styles.xml
[Android] No android/app/src/main/res/values-v31/styles.xml found in
your Android project
[Android] Creating android/app/src/main/res/values-v31/styles.xml and
adding it to your Android project
[Android] - android/app/src/main/res/values-night-v31/styles.xml
[Android] No android/app/src/main/res/values-night-v31/styles.xml
found in your Android project
[Android] Creating
android/app/src/main/res/values-night-v31/styles.xml and adding it to
your Android project
[Android] - android/app/src/main/res/values/styles.xml
[Android] - android/app/src/main/res/values-night/styles.xml
Creating images
Creating dark mode images
Updating ios/Runner/Info.plist for status bar hidden/visible
[Web] Creating images
[Web] Creating images
[Web] Creating background images
[Web] Creating CSS
[Web] Updating index.html
✅ Native splash complete.
Now go finish building something awesome! 💪 You rock! 🤘🤩
Like the package? Please give it a 👍 here:
https://pub.dev/packages/flutter_native_splash
Generated splash screens ✅
Run subprocess:
['/opt/hostedtoolcache/flutter/stable-3.27.3-x64/bin/flutter',
'build', 'apk', '--no-version-check', '--suppress-analytics',
'--split-per-abi', '--build-number', '13', '--build-name', '13.0.0',
'--release', '--analyze-size', '--target-platform', 'android-arm']
[18:57:24] Resolving dependencies...
Downloading packages...
[18:57:25] archive 3.6.1 (4.0.2 available)
characters 1.3.0 (1.4.0 available)
clock 1.1.1 (1.1.2 available)
collection 1.19.0 (1.19.1 available)
fl_chart 0.69.2 (0.70.2 available)
! flet 0.26.0 (overridden)
flutter_lints 2.0.3 (5.0.0 available)
image 4.3.0 (4.5.2 available)
intl 0.19.0 (0.20.2 available)
js 0.6.7 (0.7.1 available)
lints 2.1.1 (5.1.1 available)
lottie 3.3.0 (3.3.1 available)
material_color_utilities 0.11.1 (0.12.0 available)
meta 1.15.0 (1.16.0 available)
path 1.9.0 (1.9.1 available)
petitparser 6.0.2 (6.1.0 available)
sensors_plus 4.0.2 (6.1.1 available)
sensors_plus_platform_interface 1.2.0 (2.0.1 available)
toml 0.15.0 (0.16.0 available)
url_strategy 0.2.0 (discontinued)
! wakelock_plus 1.2.10 (overridden)
! web 1.1.0 (overridden)
web_socket_channel 2.4.5 (3.0.2 available)
! webview_flutter_android 4.3.1 (overridden)
win32_registry 1.1.5 (2.0.1 available)
! window_manager 0.4.3 (overridden)
Got dependencies!
1 package is discontinued.
21 packages have newer versions incompatible with dependency
constraints.
Try `flutter pub outdated` for more information.
[18:59:14] Running Gradle task 'assembleRelease'...
Warning: Errors during XML parse:
Warning: Additionally, the fallback loader failed to parse the XML.
Warning: Errors during XML parse:
Warning: Additionally, the fallback loader failed to parse the XML.
Checking the license for package NDK (Side by side) 25.1.8937393 in
/usr/local/lib/android/sdk/licenses
License for package NDK (Side by side) 25.1.8937393 accepted.
Preparing "Install NDK (Side by side) 25.1.8937393 v.25.1.8937393".
[18:59:29] "Install NDK (Side by side) 25.1.8937393 v.25.1.8937393" ready.
Installing NDK (Side by side) 25.1.8937393 in
/usr/local/lib/android/sdk/ndk/25.1.8937393
"Install NDK (Side by side) 25.1.8937393 v.25.1.8937393" complete.
"Install NDK (Side by side) 25.1.8937393 v.25.1.8937393" finished.
[18:59:38] Checking the license for package Android SDK Platform 31 in
/usr/local/lib/android/sdk/licenses
License for package Android SDK Platform 31 accepted.
Preparing "Install Android SDK Platform 31 (revision 1)".
[18:59:41] "Install Android SDK Platform 31 (revision 1)" ready.
Installing Android SDK Platform 31 in
/usr/local/lib/android/sdk/platforms/android-31
"Install Android SDK Platform 31 (revision 1)" complete.
"Install Android SDK Platform 31 (revision 1)" finished.
Checking the license for package Android SDK Platform 33 in
/usr/local/lib/android/sdk/licenses
License for package Android SDK Platform 33 accepted.
Preparing "Install Android SDK Platform 33 (revision 3)".
[18:59:43] "Install Android SDK Platform 33 (revision 3)" ready.
Installing Android SDK Platform 33 in
/usr/local/lib/android/sdk/platforms/android-33
"Install Android SDK Platform 33 (revision 3)" complete.
"Install Android SDK Platform 33 (revision 3)" finished.
[19:00:10] Font asset "CupertinoIcons.ttf" was tree-shaken, reducing it from
257628 to 209160 bytes (18.8% reduction). Tree-shaking can be
disabled by providing the --no-tree-shake-icons flag when building
your app.
Font asset "MaterialIcons-Regular.otf" was tree-shaken, reducing it
from 1645184 to 1261080 bytes (23.3% reduction). Tree-shaking can be
disabled by providing the --no-tree-shake-icons flag when building
your app.
[19:01:13] Generating lint files for backported methods only (compile API B)
[19:01:22] Checking the license for package CMake 3.22.1 in
/usr/local/lib/android/sdk/licenses
License for package CMake 3.22.1 accepted.
Preparing "Install CMake 3.22.1 v.3.22.1".
[19:01:24] "Install CMake 3.22.1 v.3.22.1" ready.
Installing CMake 3.22.1 in /usr/local/lib/android/sdk/cmake/3.22.1
"Install CMake 3.22.1 v.3.22.1" complete.
"Install CMake 3.22.1 v.3.22.1" finished.
[19:01:29] Caught exception: Already watching path:
/home/runner/work/ynet/ynet/build/flutter/android
[19:02:32] Running Gradle task 'assembleRelease'...
307.2s
[19:02:33] ✓ Built build/app/outputs/flutter-apk/app-armeabi-v7a-release.apk
(26.6MB)
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
▒▒▒▒▒▒▒▒▒▒▒
app-armeabi-v7a-release.apk (total compressed)
25 MB
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
━━━━━━━━━━━
[19:02:36] META-INF/
androidx
3 KB
CERT.SF
17 KB
CERT.RSA
1019 B
MANIFEST.MF
15 KB
assets/
flutter_assets
1 MB
classes.dex
581 KB
lib/
armeabi-v7a
22 MB
Dart AOT symbols accounted decompressed size
15 MB
package:flutter
6 MB
package:flet
2 MB
package:highlight
1 MB
package:flutter_localizations
519 KB
package:lottie
435 KB
dart:core
393 KB
dart:ui
283 KB
package:fl_chart
266 KB
dart:typed_data
258 KB
package:vector_graphics_compiler
189 KB
dart:io
173 KB
package:markdown
140 KB
package:intl
52 KB
io.9.png
1 KB
kG.png
28 KB
mi.png
18 KB
nf.png
1 KB
o-.png
19 KB
qD.9.png
3 KB
rj.9.png
1 KB
tP.png
22 KB
yi.png
14 KB
yj.png
10 KB
yn.png
4 KB
zV.9.png
2 KB
resources.arsc
181 KB
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
▒▒▒▒▒▒▒▒▒▒▒
A summary of your APK analysis can be found at:
/home/runner/.flutter-devtools/apk-code-size-analysis_01.json
To analyze your app size in Dart DevTools, run the following command:
dart devtools --appSizeBase=apk-code-size-analysis_01.json
Built .apk for Android ✅
Copying build output from:
/home/runner/work/ynet/ynet/build/flutter/build/app/outputs/flutter-a
pk/*
Copied build to build/apk directory ✅
╭──────────────────────────────────────────────────────────────────────────────╮
│ Successfully built your .apk for Android! 🥳 Find it in build/apk directory. │
│ 📁 │
╰──────────────────────────────────────────────────────────────────────────────╯
I gave flet-lottie a try with the Flet v0.26.0, and it worked:
main.py
import flet as ft
import flet_lottie as lottie
def main(page: ft.Page):
page.horizontal_alignment = ft.CrossAxisAlignment.CENTER
page.add(
lottie.Lottie(
src="https://raw.githubusercontent.com/xvrh/lottie-flutter/master/example/assets/Mobilo/A.json",
reverse=False,
animate=True,
),
lottie.Lottie(
src="https://raw.githubusercontent.com/xvrh/lottie-flutter/master/example/assets/Mobilo/A.json",
reverse=True,
animate=True,
),
)
ft.app(main)
pyproject.toml
[project]
name = "LottiePlayground"
version = "0.1.0"
description = "Testing Lottie in Flet"
requires-python = ">=3.9"
authors = [
{ name = "TheEthicalBoy", email = "[email protected]" }
]
dependencies = [
"flet-lottie",
"flet==0.26.0"
]
[tool.flet]
org = "com.theethicalboy"
product = "LottiePlayground"
company = "TheEthicalBoy"
[tool.flet.app]
path = "."
[tool.flet.flutter]
dependencies = ["flet_lottie"]
[tool.poetry]
package-mode = false
I gave flet-lottie a try with the Flet v0.26.0, and it worked:
main.py
import flet as ft import flet_lottie as lottie
def main(page: ft.Page): page.horizontal_alignment = ft.CrossAxisAlignment.CENTER
page.add( lottie.Lottie( src="https://raw.githubusercontent.com/xvrh/lottie-flutter/master/example/assets/Mobilo/A.json", reverse=False, animate=True, ), lottie.Lottie( src="https://raw.githubusercontent.com/xvrh/lottie-flutter/master/example/assets/Mobilo/A.json", reverse=True, animate=True, ), )ft.app(main)
pyproject.toml
[project] name = "LottiePlayground" version = "0.1.0" description = "Testing Lottie in Flet" requires-python = ">=3.9" authors = [ { name = "TheEthicalBoy", email = "[email protected]" } ] dependencies = [ "flet-lottie", "flet==0.26.0" ]
[tool.flet] org = "com.theethicalboy" product = "LottiePlayground" company = "TheEthicalBoy"
[tool.flet.app] path = "."
[tool.flet.flutter] dependencies = ["flet_lottie"]
[tool.poetry] package-mode = false
Ok, I will try again and give you feedback.
This is no longer needed, guys:
[tool.flet.flutter]
dependencies = ["flet_lottie"]
Thank you, I rebuilt the app and it's working :)