Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Kivy/Buildozer Import Error - pymssql.so is 64-bit instead of 32-bit

I'm using the 64-bit Kivy/Buildozer VM to build and deploy a Kivy app to Android Lollipop (armeabi-v7a 32-bit arch).

The Buildozer build is successful but on execution of the app and import of the pymssql package (used to connect to a remote MS SQL server) I get the following error:

I/python  ( 5335):    File "/build/phytogp/android/app/main.py", line 4, in <module>
I/python  ( 5335):    File "/build/phytogp/android/app/views/apps/phyto_app.py", line 45, in <module>
I/python  ( 5335):    File "/build/phytogp/android/app/services/twilio_service.py", line 2, in <module>
I/python  ( 5335):  ImportError: dlopen failed: "/data/data/com.phyto.phytogp/files/app/lib/python2.7/site-packages/pymssql.so" is 64-bit instead of 32-bit

As I understand it, the pre-built pymssql-2.1.3-cp27-cp27mu-manylinux1_x86_64.whl wheel for pymssql should support both 64 and 32-bit arch.

How can I get a pymssql.so that supports 32-bit?

like image 769
darthpaul Avatar asked Mar 06 '18 02:03

darthpaul


1 Answers

There is 2 things to checks:

  1. ensure you have the 32 bits version packaged. You said the wheel should support 64 and 32 bits, but you referenced the x86_64 wheel version. On their pypi page, they have a i686 version, that's your 32 bits version that you want.

  2. even if it's 32 or 64, it must be ARM >= v7a compiled. Unless your wheels have been compiled specifically for android, there is a great chance it just doesn't work, because the libc is not the same on Linux and Android. So you'll hit binary incompatibility.

That's why for that kind of libraries, you need to write a recipe in python-for-android to compile the library for Android.

like image 103
tito Avatar answered Nov 13 '22 18:11

tito