joaoventura / pybridge

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

there is an error... #16

Closed jakchang closed 5 years ago

jakchang commented 6 years ago

I downloaded your pybridge but it dosent work... the error is java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader ~~ " couldn't find libpybridge.so " how to fix it?

joaoventura commented 6 years ago

Did you ran the ndk-build command, as stated in the readme instructions?

Finally, open the terminal, cd to app/src/main/jni, and run path/to/crystax/ndk-build. You should have libcrystax, libpython3.5 and libpybridge in src/main/libs.

cenkersisman commented 4 years ago

The same error occured to me although I run ndk-build without problem.

lucaslampier commented 4 years ago

I had the same issue In my case, when NDK compiled the files to android it stored the files in a subdirectory inside the jni folder respective to the arm architectures that you specified in the Android.mk file (armeabi-v7a). All you have to do is to specify in the gradle file that you are using only the armeabi-v7a architecture.

Summarizing, all I had to do to solve the problem was to put

android { defaultConfig { ndk { abiFilters 'armeabi-v7a' } } } inside the build.gradle file.

ref: https://developer.android.com/ndk/guides/abis#gradle

A better solution wold be compiling the native code for all arm architectures. However, I could not do it.