[Question] SQLAlchemy on Android when building to apk #4871
-
QuestionThe package is available at https://pypi.flet.dev/SQLAlchemy. But neither with uv or poetry I'm able to include the wheel in the build to apk. Either the build tries to use the standard SQLAlchemy, which will not install: or uv will complain that the wheel is not for linux (even though i'm building for android with uv run flet build apk) with something like: [[tool.uv.index]] or poetry will cause a rich.error.MarkupError during the poetry run flet build apk with something like: No matter what I try I seem to be unable to include the package in the build. Am I doing something wrong with the setup? I can't seem to find any documentation on how to include these prebuilt packages. Thanks in advance. Code sampleNo response Error messagejcremers AAP-5CG4353D1W ~ repositories tracker_android main 9✎ 2? $ poetry run flet build apk -v
[09:55:05] Flutter 3.27.3 installed ✅
Flutter executable: /home/jcremers/flutter/3.27.3/bin/flutter
Dart executable: /home/jcremers/flutter/3.27.3/bin/dart
JDK installed at /home/jcremers/java/17.0.13+11
Configuring Flutter's path to JDK
Run subprocess: ['/home/jcremers/flutter/3.27.3/bin/flutter', 'config', '--suppress-analytics', '--jdk-dir=/home/jcremers/java/17.0.13+11']
Setting "jdk-dir" value to "/home/jcremers/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 /home/jcremers/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: {}
[09:55:07] Created Flutter bootstrap project from gh:flet-dev/flet-build-template with ref "0.26.0" ✅
Run subprocess: ['/home/jcremers/flutter/3.27.3/bin/dart', 'run', '--suppress-analytics', 'serious_python:main', 'package',
'/home/jcremers/repositories/tracker_android/src', '--platform', 'Android', '--requirements',
'/home/jcremers/repositories/tracker_android/SQLAlchemy_2_0_36_1_cp312_cp312_android_24_arm64_v8a_whl,flet==0.26.0', '--exclude', 'build', '--cleanup']
[09:55:08] Running package command
Extra PyPi indexes:
Created temp directory: /tmp/serious_python_tempEFBORW
Copying Python app from /home/jcremers/repositories/tracker_android/src to a temp directory
Cleanup app
Configured Android/arm64-v8a platform with sitecustomize.py
( ● ) Packaging Python app...
Traceback (most recent call last):
File "/home/jcremers/.cache/pypoetry/virtualenvs/tracker-android-DZAybo-i-py3.11/bin/flet", line 8, in <module>
sys.exit(main())
^^^^^^
File "/home/jcremers/.cache/pypoetry/virtualenvs/tracker-android-DZAybo-i-py3.11/lib/python3.11/site-packages/flet/cli.py", line 11, in main
flet_cli.cli.main()
File "/home/jcremers/.cache/pypoetry/virtualenvs/tracker-android-DZAybo-i-py3.11/lib/python3.11/site-packages/flet_cli/cli.py", line 89, in main
args.handler(args)
File "/home/jcremers/.cache/pypoetry/virtualenvs/tracker-android-DZAybo-i-py3.11/lib/python3.11/site-packages/flet_cli/commands/build.py", line 560, in handle
self.package_python_app()
File "/home/jcremers/.cache/pypoetry/virtualenvs/tracker-android-DZAybo-i-py3.11/lib/python3.11/site-packages/flet_cli/commands/build.py", line 1534, in package_python_app
package_result = self.run(
^^^^^^^^^
File "/home/jcremers/.cache/pypoetry/virtualenvs/tracker-android-DZAybo-i-py3.11/lib/python3.11/site-packages/flet_cli/commands/build.py", line 1766, in run
return processes.run(
^^^^^^^^^^^^^^
File "/home/jcremers/.cache/pypoetry/virtualenvs/tracker-android-DZAybo-i-py3.11/lib/python3.11/site-packages/flet_cli/utils/processes.py", line 61, in run
log(stdout_line.rstrip())
File "/home/jcremers/.cache/pypoetry/virtualenvs/tracker-android-DZAybo-i-py3.11/lib/python3.11/site-packages/flet_cli/commands/build.py", line 1814, in log_stdout
console.log(
File "/home/jcremers/.cache/pypoetry/virtualenvs/tracker-android-DZAybo-i-py3.11/lib/python3.11/site-packages/rich/console.py", line 1947, in log
renderables = self._collect_renderables(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/jcremers/.cache/pypoetry/virtualenvs/tracker-android-DZAybo-i-py3.11/lib/python3.11/site-packages/rich/console.py", line 1539, in _collect_renderables
self.render_str(
File "/home/jcremers/.cache/pypoetry/virtualenvs/tracker-android-DZAybo-i-py3.11/lib/python3.11/site-packages/rich/console.py", line 1429, in render_str
rich_text = render_markup(
^^^^^^^^^^^^^^
File "/home/jcremers/.cache/pypoetry/virtualenvs/tracker-android-DZAybo-i-py3.11/lib/python3.11/site-packages/rich/markup.py", line 167, in render
raise MarkupError(
rich.errors.MarkupError: closing tag '[/home/jcremers/repositories/tracker_android/SQLAlchemy_2_0_36_1_cp312_cp312_android_24_arm64_v8a_whl, flet==0.26.0]' at position 11 doesn't match any open tag ------------------------------------------------------
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 25 replies
-
This bug has been fixed (#4796) and is part of the latest pre-release: |
Beta Was this translation helpful? Give feedback.
-
SQLAlchemy still refuses to be build for Android, more information below:
with the "path = ..." dependency SQLAlchemy can be installed with poetry lock => poetry install. but when running poetry run flet build apk -v: with the "url = ..." dependency SQLAlchemy refuses to be installed by poetry lock => poetry install: and trying to build with this dependency: both builds used the poetry run flet build apk -v command. i'm at a loss what needs to be done in order to use one of the packages from https://pypi.flet.dev and have it build on Android sucessfully... thanks in advance. |
Beta Was this translation helpful? Give feedback.
-
Even with 2.0.38 I'm not getting any error as they provide "any" wheel (it's just without compiled ORM optimizations). |
Beta Was this translation helpful? Give feedback.
We've just published
greenlet
package for iOS and Android.Try re-building the app again.