Android cannot load local libcrypto unsatisfied link error

I need to run a newer version of openssl in my application than the one that is included in the OS. I was able to install the patch and the Android source to compile a newer version, and then extract the shared library for use in my application.

Then I was able to compile and link my own code, which requires a function only in new versions of openssl against my new shared library (the patch for the newer opensl worked).

I also managed to create several jni functions that work as expected, but as soon as I added to the function, which is located only in the new opensl library local to the application, I get an unsatisfied link error.

My guess is that the system version of libcrypto and libssl overrides my local versions in /libs/armeabi/libcrypto.so and / libs / armeabi / libssl.so .... how do I fix this?

+2
source share
2 answers

The system already comes with a library known as libcrypto, and it will be selected in front of your library. The easiest solution is to give your library a different name and use it in your call System.loadLibrary(...).

Update

As you indicated, you will need to rebuild the library with a new name instead of simply renaming the file.

+4
source

JNI . . JVM -Djava.library.path=/libs/armeabi LD_LIBRARY_PATH. Android , java.library.path ( , ), - . Android, NDK.

0

Source: https://habr.com/ru/post/1532652/


All Articles