Android can't load local libcrypto unsatisfied link error

前端 未结 2 1432
小蘑菇
小蘑菇 2021-01-22 09:02

I need to run a newer version of openssl in my app than the one that comes in the OS. I was able to patch and android source to compile a newer version and then extract the shar

相关标签:
2条回答
  • 2021-01-22 09:28

    Yes JNI is picking up the system versions. It didn't use your patched versions at all. On standalone JVM you would say -Djava.library.path=/libs/armeabi or modify environment variable LD_LIBRARY_PATH. On Android i guess you can either look up the system property java.library.path and put your libs in some known place (but before the folder where the system versions are) or actually modify the property - prepend the path to your local versions. I do have some experience with Android but not specifically with NDK.

    0 讨论(0)
  • 2021-01-22 09:29

    The system already ships with a library known as libcrypto, and that will be picked before your library will. The easiest solution is to give your library a different name, and use that in your System.loadLibrary(...) call.

    Update

    As you pointed out, you will need to rebuild the library with the new name, in stead of just renaming the file.

    0 讨论(0)
提交回复
热议问题