Replies: 1 comment 12 replies
-
Try adding [project]
name = "map_ortho_shp"
version = "1.1.0"
description = ""
readme = "README.md"
requires-python = ">=3.8"
dependencies = [
"flet==0.25.2",
"numpy",
"flet.map",
"shapely",
"flet-libcpp-shared"
] |
Beta Was this translation helpful? Give feedback.
12 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Dear developper,
The error I have is similar to error described in #4198 , #4203,
After reinstalling all tools and software from scratch, I finally generated the APK, but the app doesn't work.
(venv) C:\Users\JeanClaude\Documents\Flet\map_ortho_shp>flet build apk
[17:56:28] Created Flutter bootstrap project from gh:flet-dev/flet-build-template with ref 0.25.2 ✅
Customized app icons and splash images ✅
[17:56:31] Generated app icons ✅
[17:56:32] Generated splash screens ✅
[17:57:46] Packaged Python app ✅
[17:58:22] Built .apk for Android ✅
Copied build to build\apk directory ✅
Successfully built your .apk for Android! 🥳 Find it in build\apk directory. 📁
The pyproject.toml :
[project]
name = "map_ortho_shp"
version = "1.1.0"
description = ""
readme = "README.md"
requires-python = ">=3.8"
dependencies = [
"flet==0.25.2",
"numpy",
"flet.map",
"shapely"
]
In Android emulator, the following error appears with android 13 or 14 (API 33 or 34, Pixel 8 device).
... ImportError: dlopen failed: library "libc++_shared.so" not found ...
details here from the emulated phone :
"
Traceback (most recent call last):
File "/data/user/0/com.mycompany.map_ortho_shp/files/flet/python_site_packages/numpy/_core/init.py", line 23, in
from . import multiarray
File "/data/user/0/com.mycompany.map_ortho_shp/files/flet/python_site_packages/numpy/_core/multiarray.py", line 10, in
from . import overrides
File "/data/user/0/com.mycompany.map_ortho_shp/files/flet/python_site_packages/numpy/_core/overrides.py", line 8, in
from numpy._core._multiarray_umath import (
ImportError: dlopen failed: library "libc++_shared.so" not found: needed by /data/data/com.mycompany.map_ortho_shp/files/flet/python_site_packages/numpy/_core/_multiarray_umath.cpython-312.so in namespace classloader-namespace
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/data/user/0/com.mycompany.map_ortho_shp/files/flet/python_site_packages/numpy/init.py", line 114, in
from numpy.config import show as show_config
File "/data/user/0/com.mycompany.map_ortho_shp/files/flet/python_site_packages/numpy/config.py", line 4, in
from numpy._core._multiarray_umath import (
File "/data/user/0/com.mycompany.map_ortho_shp/files/flet/python_site_packages/numpy/_core/init.py", line 49, in
raise ImportError(msg)
ImportError:
IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!
Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.
We have compiled some common reasons and troubleshooting tips at:
https://numpy.org/devdocs/user/troubleshooting-importerror.html
Please note and check the following:
The Python version is: Python3.12 from ""
The NumPy version is: "2.1.1"
and make sure that they are the versions you expect.
Please carefully study the documentation linked above for further help.
Original error was: dlopen failed: library "libc++_shared.so" not found: needed by /data/data/com.mycompany.map_ortho_shp/files/flet/python_site_packages/numpy/_core/_multiarray_umath.cpython-312.so in namespace classloader-namespace
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/data/user/0/com.mycompany.map_ortho_shp/files/flet/python_site_packages/numpy/init.py", line 119, in
raise ImportError(msg) from e
ImportError: Error importing numpy: you should not try to import numpy from
its source directory; please exit the numpy source tree, and relaunch
your python interpreter from there.
Traceback (most recent call last):
File "", line 47, in
File "", line 229, in run_module
File "", line 88, in _run_code
File "/data/user/0/com.mycompany.map_ortho_shp/files/flet/app/main.py", line 20, in
from shapely.geometry import Point, Polygon
File "/data/user/0/com.mycompany.map_ortho_shp/files/flet/python_site_packages/shapely/init.py", line 1, in
from shapely.lib import GEOSException # NOQA
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ImportError: numpy._core.multiarray failed to import
"
On the real phone, nothing is displayed , only white screen.
The application run correctly on Window (with the command : flet run)
I don't know how to solve this problem,
As the error comes from : ImportError: dlopen failed: library "libc++_shared.so" not found...
Add the missing file "libc++_shared.so" to the APK could be a solution, but how to do that ?
Thanks a lot,
JC
Beta Was this translation helpful? Give feedback.
All reactions