2

I am building my first kivy application for android. I want to include 'spacy' for natural language processing. Looks like importing spacy is dependent on 'ujson' and any app I build that imports spacy and requires 'ujson' fails with the error:

ImportError: dlopen failed: 
"/data/data/org.kivy_test.kivy_test/files/app/_python_bundle/site- 
packages/srsly/ujson/ujson.so" is 64-bit instead of 32-bit

Any ideas on a simple way to resolve, ie how could I use 32-bit ujson?

This can be reproduced with a very simple python kivy app that simply imports spacy, no requirement to use it.

This is being done on an ubuntu VM using buildozer.

[INFO   ] [Kivy        ] v1.10.1
[INFO   ] [Python      ] v3.6.7 (default, Oct 22 2018, 11:32:17) 
[GCC 8.2.0]

buildozer.spec  
requirements = python3,kivy,spacy,thinc,numpy,srsly
osx.python_version = 3
osx.kivy_version = 1.9.1
android.arch = armeabi-v7a
steve
  • 21
  • 1
  • 1
    The actual problem is that ujson has a compiled component (ujson.so), but p4a doesn't know how to compile it and so you've ended up with a 64 bit desktop version in the apk. ujson probably needs a recipe, although I'm not sure if this is working automatically now in python-for-android master. – inclement Apr 24 '19 at 18:05
  • 1
    Thanks, I am very new to this, any pointers would be gratefully appreciated. I have seen similar issues, different libs, but no clear solutions. I have found the following ujson recipe, but not sure if this is what I need, or how to use it? https://github.com/kivy/python-for-android/blob/master/pythonforandroid/recipes/ujson/__init__.py – steve Apr 24 '19 at 18:48
  • Did you resolve the issue? – pouya Sep 12 '20 at 19:17

0 Answers0