Open jtoror opened 1 month 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)?
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.
Pandas is working now in emulator: https://github.com/flet-dev/flet/issues/4203#issuecomment-2427564792
What emulator is that? What's host machine/OS, ARM or Intel?
What emulator is that? What's host machine/OS, ARM or Intel?
On my phone a MOTOe5 plus https://www.gsmarena.com/motorola_moto_e5_plus-9095.php
host Intel x64
I deleted my .venv and build folder, created my virtual environment from scratch and created the new build.
I can't reproduce the issue. What Android SDK is used for emulator?
Hi Feodor, this is driving me crazy, it's a physical phone, with Android Oreo, Cortex-A53 but I have all the libraries running perfectly except pandas. I tried replacing them with other frameworks, but there are no wheels available, so I'm still struggling with pandas, I tried installing pandas==2.0.3 which has 32-bit wheels to see if it would run and I couldn't do it either, since it gives an error when compiling the apk.
On this same phone I have run pandas==2.2.2 with Buildozier and with previous versions of flet using the create command, but with build apk it compiles fine, but gives an error.
It runs without problems on emulator.
I have a tablet with Android 5 and it turns out that the compilation does not run on that abi.
I downloaded and modified the template, changed the SDK to 21 but it did not compile, I got an error when compiling the apk with build apk.
I don't know how to fix this anymore, I need to run pandas.
Another local thing is that it doesn't translate the dates into my local language. I had to install Babel.
I don't know what Android SDK does Kivy target (used by Buldozer), but Flet is targeting SDK 34 which is Android 14+: https://apilevels.com/
This is forced by Google. You cannot upload your app to Google Play if it's not targeting Android 14 (API level 34): https://developer.android.com/google/play/requirements/target-sdk
It's correct but I need an apk that won't be on Google Play
but the error seems to me to be due to the 64-bit architecture but as I said it had already worked before.
I don't know what Android SDK does Kivy target (used by Buldozer), but Flet is targeting SDK 34 which is Android 14+: https://apilevels.com/
This is forced by Google. You cannot upload your app to Google Play if it's not targeting Android 14 (API level 34): https://developer.android.com/google/play/requirements/target-sdk
Alright, it's 32-bit OS. I will take a look, when have a moment, what might be wrong with pandas package on that platform.
Alright, it's 32-bit OS. I will take a look, when have a moment, what might be wrong with pandas package on that platform.
Thank you very much, friend, I'll be waiting, a hug.
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