joaoventura / pybridge

Reuse Python code in native Android applications
215 stars 56 forks source link

libpybridge.so x86? #12

Closed jbmlaird closed 7 years ago

jbmlaird commented 7 years ago

I ran the ndk-build to create libcrystax.so, libpybridge.so and libpython3.5m.so in my src/main/libs/armeiabi-v7a however when trying to run the app on a x86 emulator it cannot find libpybridge.so. I copied over the armeabi-v7a libpybridge.so to an x86 folder and then get an unexpected e_machine: 40 error presumably because it's the wrong compilation. How do I get a x86 copy of libpybridge.so and other versions?

joaoventura commented 7 years ago

Armeiabi-v7a refers to the ARM microprocessors, which are the microprocessors running on most Android devices. You want X86 which are Intel microprocessors (most microprocessors running desktop/laptop computers and some android devices).

So instead of using libcrystax and libpython3.5 from crystax's armeabi folders, you have to search for and use those files compiled for intel's x86 microprocessors. Also, when you compile libpybridge, you'll have to explicitly say that you want a x86 target.

jbmlaird commented 7 years ago

Thanks.

For future readers, you need to add the following to your Application.mk

APP_ABI := armeabi-v7a x86 (or other relevant platforms)