kivy / kivy/python-for-android

Recipe request: h3 for Android / timezonefinder 8.x fails with x86_64 h3 .so in arm64-v8a APK

未关闭
#3,348 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Python
星标
8.9k
派生
2k
平均合并
12 小时 20 分钟
30 天内合并 PR
9

描述

I have been told to be free to request a working python-for-android recipe for `h3`.

The practical issue is that current `timezonefinder` versions depend on `h3`. With Buildozer / python-for-android, the APK builds, but the application crashes at runtime on an Android arm64 device because the packaged `h3` native extension is for x86_64 instead of ARM64.

For now I have to pin:

```ini
timezonefinder==4.4.1
```

because newer `timezonefinder` versions pull in `h3`. I am not sure how long this is viable.

## Runtime error

On Android, importing `timezonefinder` imports `h3`, and this fails:

```text
ImportError: dlopen failed: "/data/data/xx.xx.xx/files/app/_python_bundle/site-packages/h3/_cy/cells.so" is for EM_X86_64 (62) instead of EM_AARCH64 (183)
```

Relevant traceback:

```text
File ".../timezonefinder/__init__.py", line 1, in
File ".../timezonefinder/timezonefinder.py", line 22, in
File ".../h3/__init__.py", line 3, in
File ".../h3/api/__init__.py", line 3, in
File ".../h3/api/basic_int/__init__.py", line 5, in
File ".../h3/_cy/__init__.py", line 16, in
ImportError: dlopen failed: ".../h3/_cy/cells.so" is for EM_X86_64 (62) instead of EM_AARCH64 (183)
```

## Environment

```text
OS: Linux Mint / Ubuntu 24.04 base
Python: 3.12.3 virtualenv
Buildozer: 1.6.1.dev0 from git
python-for-android branch: develop
python-for-android commit: 70f92243
Android API: 36
Android min API: 24
Android NDK: r28c
Target architecture: arm64-v8a / armeabi-v7a
Device: arm64 Android device
```

## Relevant requirements

In the real project this happens with:

```ini
requirements = python3,kivy==2.3.1,android,jpeg,pillow,olefile,pytz,skyfield,numpy,jplephem,sgp4,h3,timezonefinder
```

A reduced version could look like this:

```ini
requirements = python3,kivy==2.3.1,android,numpy,h3,timezonefinder
```

贡献指南

打开贡献指南

调研方向

从 h3/_cy/__init__.py 导入路径以及包含 h3 和 timezonefinder 的精简 requirements 开始,然后为列出的 arm64-v8a 目标进行构建。在 arm64 Android 设备上成功导入 timezonefinder 且不出现 EM_X86_64 与 EM_AARCH64 不匹配错误,即表示完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
android, python
领域
build-system, mobile
Issue 类型
功能
难度
4/5
预计耗时
3-5 天
活跃度
冷清
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。