flet icon indicating copy to clipboard operation
flet copied to clipboard

flet==0.25.0.dev3526 apk "Android" error cffi: Unable to build parse

Open InesaFitsner opened this issue 1 year ago • 0 comments

Duplicate Check

  • [X] I have searched the opened issues and there are no duplicates

Describe the bug

After building apk with cffi package and running it on Android device simulator, import cffi works but after there is "Unable to build parse" error.

Code sample

Code
import flet as ft


def main(page: ft.Page):
    page.title = "Flet libs test"

    def cffi_tests(e):
        def test_basic():
            try:
                from cffi import FFI

                page.add(ft.Text("from cffi import FFI - OK"))

                ffi = FFI()
                ffi.cdef("size_t strlen(char *str);")
                page.add(ft.Text('ffi.cdef("size_t strlen(char *str);") - OK'))
                lib = ffi.dlopen(None)
                page.add(ft.Text("ffi.dlopen(None) - OK"))
                assert lib.strlen(ffi.new("char[]", b"hello world")) == 11

                page.add(ft.Text("cffi: test_basic - OK"))
            except Exception as e:
                page.add(ft.Text(f"cffi: test_basic - error: {e}", selectable=True))

        test_basic()

    page.add(
        ft.SafeArea(
            ft.Column(
                [
                    ft.ElevatedButton("Run cffi tests", on_click=cffi_tests),
                ]
            )
        )
    )


ft.app(main)

pyproject.toml

[project]

name = "cffi_app"
version = "1.0.0"
description = ""
authors = [{name = "Flet Developer", email = "[email protected]"}]
dependencies = ["flet==0.25.0.dev3526", "cffi"]

[tool.flet]
android.adaptive_icon_background = "#ffffff"

To reproduce

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

Expected behavior

expected to see "Test OK" messages

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
[Paste your logs here]

Additional details

No response

InesaFitsner avatar Oct 24 '24 17:10 InesaFitsner