Android无法加载本地libcrypto不合适的链接错误 [英] Android can't load local libcrypto unsatisfied link error

查看:935
本文介绍了Android无法加载本地libcrypto不合适的链接错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要在我的比来在操作系统中的一个应用程序运行的OpenSSL的新版本。我能够修补和编译一个新版本的Andr​​oid源代码,然后提取共享库在我的应用程序使用。

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.

我就能够编译和链接我的家乡code,需要一个功能,仅在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).

我还能够创建达到预期效果,但只要我添加的功能只适用于较新的OpenSSL的共享库本地​​的应用程序,我得到一个不合适的链接错误数JNI函数。

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无法加载本地libcrypto不合适的链接错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆