kivy / kivy/python-for-android
rust recipe shazamio-core, builds fine, but cannot locate symbol __gxx_personality_v0
- Dominant language
- Python
- Stars
- 8.9k
- Forks
- 2k
- Avg merge
- 12h 20m
- Merged PRs (30d)
- 9
Description
### 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
Contributor guide
Research direction
Start with the custom ShazamIoCoreRecipe and the RustCompiledComponentsRecipe implementation, then reproduce the Android import failure using the provided buildozer.spec configuration. Inspect the generated shazamio_core.so and the build output for the missing symbol reference. Done means the package imports successfully at runtime on the reported Android architectures without build errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, python, rust
- Domain
- build-system, mobile
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100