kivy / kivy/python-for-android
rust recipe shazamio-core, builds fine, but cannot locate symbol __gxx_personality_v0
- Ngôn ngữ chính
- Python
- Star
- 8.9k
- Fork
- 2k
- Merge trung bình
- 12 giờ 20 phút
- Pull request đã merge (30 ngày)
- 9
Mô tả
### Checklist
- [x] the issue is indeed a bug and not a support request
- [x] issue doesn't already exist: https://github.com/kivy/python-for-android/issues
- [x] I have a short, runnable example that reproduces the issue
- [x] I reproduced the problem with the latest development version (`p4a.branch = develop`)
- [x] I used the grave accent (aka backticks) to format code or logs when appropriated
### Versions
- Python: 3.10
- OS: Ubuntu 22.04
- Kivy: 2.3.1
- Cython: 0.29.33
- OpenJDK: 17
### Description
I was trying to add to my project a `shazamio-core` recipe which is a rust project, so I used the recipe class `RustCompiledComponentsRecipe` and wrote my own recipe, which is this:
```
from pythonforandroid.recipe import RustCompiledComponentsRecipe
class ShazamIoCoreRecipe(RustCompiledComponentsRecipe):
version = "1.0.7"
url = (
f"https://github.com/shazamio/shazamio-core/archive/refs/tags/{version}.tar.gz"
)
site_packages = "shazamio_core"
recipe = ShazamIoCoreRecipe()
```
It compiles fine, but in android, when I launch my app I get this import error:
```
ImportError: dlopen failed: cannot locate symbol "__gxx_personality_v0" referenced by "/data/data/net.magowiz.musenote/files/app/_python_bundle/site-packages/shazamio_core/shazamio_core.so"...
```
then the app crashes
### buildozer.spec
Command:
```sh
buildozer android debug
```
Spec file:
```
title = MuseNote
package.name = musenote
package.domain = net.magowiz
source.dir = .
source.include_exts = py,png,jpg,kv,atlas
source.exclude_dirs = tests, bin, venv, source
version = 0.1
requirements = python3,kivy,kivymd,androidstorage4kivy,bawx-player,mutagen,ffpyplayer==v4.5.1,ffpyplayer_codecs,ffmpeg,
sqlalchemy,alembic,typing_extensions,mako,markupsafe,pydantic,dataclass_factory,aiohttp_retry,aiohttp,multidict,
attrs,yarl,async_timeout,charset_normalizer==2.1.1,faust-cchardet,aiosignal,frozenlist,pydub,shazamio_core,annotated_types,
https://github.com/andreyzin/ShazamIO/archive/refs/heads/bump-pydantic2.zip,pydantic-core
presplash.filename = %(source.dir)s/img/icon.png
icon.filename = %(source.dir)s/img/icon.png
orientation = portrait, landscape
osx.python_version = 3
osx.kivy_version = 1.9.1
fullscreen = 0
android.permissions = STORAGE, WRITE_EXTERNAL_STORAGE, READ_EXTERNAL_STORAGE, INTERNET,MANAGE_EXTERNAL_STORAGE,READ_MEDIA_IMAGES,READ_MEDIA_VIDEO,READ_MEDIA_AUDIO
android.api = 34
android.archs = arm64-v8a, armeabi-v7a, x86, x86_64
android.allow_backup = True
p4a.fork = kivy
p4a.branch = develop
p4a.local_recipes = p4a_recipes
ios.kivy_ios_url = https://github.com/kivy/kivy-ios
ios.kivy_ios_branch = master
ios.ios_deploy_url = https://github.com/phonegap/ios-deploy
ios.ios_deploy_branch = 1.10.0
ios.codesign.allowed = false
[buildozer]
log_level = 2
warn_on_root = 0
```
### Logs
no errors on building
Hướng dẫn đóng góp
Hướng nghiên cứu
Bắt đầu với phần triển khai custom ShazamIoCoreRecipe và RustCompiledComponentsRecipe, sau đó tái hiện lỗi import trên Android bằng cấu hình buildozer.spec được cung cấp. Kiểm tra shazamio_core.so được tạo ra và đầu ra bản build để tìm tham chiếu đến symbol bị thiếu. Được xem là hoàn tất khi package được import thành công tại runtime trên các kiến trúc Android đã báo cáo mà không có lỗi build.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- android, python, rust
- Lĩnh vực
- build-system, mobile
- Loại issue
- Lỗi
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 35/100