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.34k stars 443 forks source link

flet==0.25.0.dev3526 apk "Android" error kiwisolver: dlopen failed #4254

Open InesaFitsner opened 6 days ago

InesaFitsner commented 6 days ago

Duplicate Check

Describe the bug

After building apk with kiwisolver package and running it on Android device simulator, import kiwisolver fails with the following error: dlopen failed: library "libc++_shared.so" not found: needed by /data/data/com.flet.kiwisolver_app/files/flet/python_site_packages/kiwisolver/_cext.cpython-312.so in namespace classloader-namespace

Code sample

Code ```python import flet as ft def main(page: ft.Page): page.title = "Flet libs test" def kiwisolver_tests(e): def test_basic(): try: from kiwisolver import Solver, Variable page.add(ft.Text("kiwisolver: import - OK")) x1 = Variable("x1") x2 = Variable("x2") xm = Variable("xm") constraints = [x1 >= 0, x2 <= 100, x2 >= x1 + 10, xm == (x1 + x2) / 2] solver = Solver() for cn in constraints: solver.addConstraint(cn) solver.addConstraint((x1 == 40) | "weak") solver.addEditVariable(xm, "strong") solver.suggestValue(xm, 60) solver.updateVariables() assert xm.value() == 60 assert x1.value() == 40 assert x2.value() == 80 page.add(ft.Text("kiwisolver: test_basic - OK")) except Exception as e: page.add( ft.Text(f"kiwisolver: test_basic - error: {e}", selectable=True) ) test_basic() page.add( ft.SafeArea( ft.Column( [ ft.ElevatedButton( "Run kiwisolver tests", on_click=kiwisolver_tests ), ] ) ) ) ft.app(main) ``` pyproject.toml: ``` [project] name = "kiwisolver_app" version = "1.0.0" description = "" authors = [{name = "Flet Developer", email = "your@email.com"}] dependencies = ["flet==0.25.0.dev3526", "kiwisolver"] [tool.flet] android.adaptive_icon_background = "#ffffff" ```

To reproduce

flet build apk install apk on android device click on "Run kiwisolver tests" button

Expected behavior

Expected to see import - ok and Basic test - ok Texts

Screenshots / Videos

Captures [Upload media here]

Operating System

macOS

Operating system details

15

Flet version

0.25.0.dev3526

Regression

No, it isn't

Suggestions

No response

Logs

Logs ```console [Paste your logs here] ```

Additional details

No response

MominIqbal-1234 commented 1 day ago

i try solution but not work please you can create a google cloab link set all the dependencies in this colab and then any buddy upload the flet code and generate apk i think this is best solution