Android can't load local libcrypto unsatisfied link错误

Android can#39;t load local libcrypto unsatisfied link error(Android cant load local libcrypto unsatisfied link错误)

本文介绍了Android can't load local libcrypto unsatisfied link错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在我的应用程序中运行比操作系统中的更新版本的 openssl.我能够修补和 android 源以编译更新版本,然后提取共享库以在我的应用程序中使用.

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 shared library to use in my app.

然后,我能够编译并链接我的本机代码,该代码仅需要较新版本的 openssl 中的函数与我的新共享库(较新的 openssl 的补丁有效).

I was then able to compile and link my native code that requires a function only in newer versions of openssl against my new shared library (the patch to a newer openssl worked).

我还能够创建一些按预期工作的 jni 函数,但只要我添加了仅在应用程序本地较新的 openssl 共享库中的函数,我就会收到不满意的链接错误.

I was also able to create a few jni functions that work as expected but as soon as I added in the function that is only in the newer openssl shared library local to the app I get an unsatisfied link error.

我的假设是 libcrypto 和 libssl 的系统版本覆盖了我在/libs/armeabi/libcrypto.so 和/libs/armeabi/libssl.so 中的本地版本 .... 我该如何解决这个问题?

My assumption is that the system version of libcrypto and libssl are overriding my local versions in /libs/armeabi/libcrypto.so and /libs/armeabi/libssl.so .... how to I fix this?

推荐答案

系统已经附带了一个名为 libcrypto 的库,它将在你的库之前被选中.最简单的解决方案是给你的库一个不同的名字,并在你的 System.loadLibrary(...) 调用中使用它.

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.

更新

正如您所指出的,您需要使用新名称重建库,而不仅仅是重命名文件.

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

这篇关于Android can't load local libcrypto unsatisfied link错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本文标题为:Android can't load local libcrypto unsatisfied link错误