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.18k stars 430 forks source link

flet==0.25.0.dev3526 apk "Android" pandas error Buffer dtype mismatch, expected 'const int64_t' but got 'long long' #4199

Open jtoror opened 1 day ago

jtoror commented 1 day ago

Duplicate Check

Describe the bug

"Android" apk does not start on physical or simulated devices when requiring the pandas library, throwing error Buffer dtype mismatch, expected 'const int64_t' but got 'long long'

Code sample

Code ```python pyproject.toml [project] name = "amy_app" version = "1.0.0" description = "My first Flet project" authors = [ {name = "John Smith", email = "john@email.com"} ] dependencies = [ "flet==0.25.0.dev3526", "numpy", "pandas" ] # requires-python = ">=3.12" icon = "assets/icon" [tool.flet.android.permission] # --android-permissions "android.permission.INTERNET" = true "android.permission.CAMERA" = true "android.permission.READ_EXTERNAL_STORAGE" = true "android.permission.WRITE_EXTERNAL_STORAGE" = true "android.permission.READ_MEDIA_VISUAL_USER_SELECTED" = true main.py import os import flet as ft import numpy as np import pandas as pd def main(page: ft.Page): page.title = "Flet counter example" page.vertical_alignment = ft.MainAxisAlignment.CENTER txt_number = ft.TextField( value="0", text_align=ft.TextAlign.RIGHT, width=100) def minus_click(e): txt_number.value = str(int(txt_number.value) - 1) page.update() def plus_click(e): txt_number.value = str(int(txt_number.value) + 1) page.update() page.add( ft.Row( [ ft.IconButton(ft.icons.REMOVE, on_click=minus_click), txt_number, ft.IconButton(ft.icons.ADD, on_click=plus_click), ], alignment=ft.MainAxisAlignment.CENTER, ) ) ft.app(main) ```

To reproduce

Traceback (most recent call last): File "", line 43, in File "", line 229, in run_module File "", line 88, in _run_code File "/data/user/0/com.flet.amy_app/files/flet/app/main.py", line 4, in import pandas as pd File "/data/user/0/com.flet.amy_app/files/flet/python_site_packages/pandas/init.py", line 49, in from pandas.core.api import ( File "/data/user/0/com.flet.amy_app/files/flet/python_site_packages/pandas/core/api.py", line 1, in from pandas.libs import ( File "/data/user/0/com.flet.amy_app/files/flet/python_site_packages/pandas/libs/init.py", line 18, in from pandas._libs.interval import Interval File "interval.pyx", line 1, in init pandas._libs.interval File "hashtable.pyx", line 1, in init pandas._libs.hashtable File "missing.pyx", line 1, in init pandas.libs.missing File "/data/user/0/com.flet.amy_app/files/flet/python_site_packages/pandas/libs/tslibs/init.py", line 40, in from pandas._libs.tslibs.conversion import localize_pydatetime File "conversion.pyx", line 1, in init pandas._libs.tslibs.conversion File "offsets.pyx", line 1, in init pandas._libs.tslibs.offsets File "timestamps.pyx", line 1, in init pandas._libs.tslibs.timestamps File "tzconversion.pyx", line 55, in init pandas._libs.tslibs.tzconversion ValueError: Buffer dtype mismatch, expected 'const int64_t' but got 'long long'

Expected behavior

No response

Screenshots / Videos

Captures [Upload media here]

Operating System

Linux

Operating system details

Kubuntu 24.04

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

FeodorFitsner commented 23 hours ago

Are you getting this error on a physical device (assuming you can't run on a simulator because of shared c++ lib issue)?

If so, what kind of device is that (brand, model)?

jtoror commented 23 hours ago

Are you getting this error on a physical device (assuming you can't run on a simulator because of shared c++ lib issue)?

If so, what kind of device is that (brand, model)?

Motorola Moto E5 Plus https://www.gsmarena.com/motorola_moto_e5_plus-9095.php

It's funny because after many days I managed to use Pandas and Matplotlib in an android app using the old way of compiling and it worked

p4a create --requirements numpy,pandas,sqlite3,requests,python-dotenv,matplotlib,cryptography,imagekitio,requests-toolbelt,urllib3 --arch arm64-v8a --arch armeabi-v7a --arch x86_64 --sdk-dir $ANDROID_SDK_ROOT --ndk-dir $ANDROID_SDK_ROOT/ndk/$NDK_VERSION --android-api 33 --ndk-api 21 --color=always --bootstrap=sdl2 --permission INTERNET, WRITE_EXTERNAL_STORAGE --dist-name android

This worked before in physical and virtual.

https://discord.com/channels/981374556059086931/1244027520722931733/1259332729913348136

Now with the dev version and the new flet build it doesn't work. I don't understand why you say something about the shared C++ lib.