java.lang.UnsatisfiedLinkError: 无法加载 stlport_shared: findLibrary 返回 null (tess-two)

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/19603257/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-12 18:42:05  来源:igfitidea点击:

java.lang.UnsatisfiedLinkError: Couldn't load stlport_shared: findLibrary returned null (tess-two)

javaandroidandroid-ndktesseractsqlcipher

提问by

I am using sqlcipher.jar for encrypting database in android and also using it's native library in

我正在使用 sqlcipher.jar 来加密 android 中的数据库,并在其中使用它的本机库

libs/armeabi folder

libs/armeabi 文件夹

1)libdatabase_sqlcipher.so

1)libdatabase_sqlcipher.so

2)libsqlcipher_android.so

2)libsqlcipher_android.so

3)libstlport_shared.so

3)libstlport_shared.so

and

libs/x86 folder

libs/x86 文件夹

1)libdatabase_sqlcipher.so

1)libdatabase_sqlcipher.so

2)libsqlcipher_android.so

2)libsqlcipher_android.so

3)libstlport_shared.so

3)libstlport_shared.so

and jar file named sqlcipher.jarin libs/ folder all i have imported

和在 libs/ 文件夹中名为sqlcipher.jar 的jar 文件我已经导入

now every thing is working fine it's going good database is fetching and reading from sqlite is also working fine and also i am not getting any kind of error in SQLiteDatabase.loadLibs(context);line

现在一切正常,一切顺利,数据库正在从 SQLite 中获取和读取也工作正常,而且我在SQLiteDatabase.loadLibs(context) 中没有收到任何错误线

enter image description herebut i want to implement also OCRin my project to do that i am importing project named tess-twofrom this http://code.google.com/p/tesseract-ocr/and https://github.com/rmtheis/tess-twoin that there is a library named tess-two folder

在此处输入图片说明但我想在我的项目中也实现OCR来做到这一点,我正在从这个http://code.google.com/p/tesseract-ocr/https://github.com/rmtheis/导入名为tess-two 的项目tess-two因为有一个名为 tess-two 文件夹的库

and i am importing that project library into my android project and i cleaned my project and run it at that time i got the error in line SQLiteDatabase.loadLibs(context);

我正在将该项目库导入到我的 android 项目中,我清理了我的项目并运行它,当时我在SQLiteDatabase.loadLibs(context);行中遇到了错误

enter image description here

在此处输入图片说明

again when i removed tess-twolibrary and doing uninstall from device and doing clean and build and run it's working fine no error is occurring, i want OCR functionality also in my project can anybody help me

再次,当我删除tess-two库并从设备中卸载并进行清理和构建并运行时,它工作正常,没有发生错误,我希望我的项目中也有 OCR 功能,任何人都可以帮助我

回答by Rancs

You can try to change the line:

您可以尝试更改行:

APP_STL := gnustl_static (in the file tess-two / tess-two / jni / Application.mk)

APP_STL := gnustl_static(在文件 tess-two / tess-two / jni / Application.mk 中)

to: APP_STL := stlport_static

到: APP_STL := stlport_static

回答by user1738315

I was running into the same issue. First of all, check that all the libraries are correctly imported.

我遇到了同样的问题。首先,检查所有库是否正确导入。

In my case the problem was that when we added another library project, these project had a armeabi_v7 folder, so apparently if will take precedence over the armeabi folder, meaning that the sqlitecypher libraries won't be located.

在我的情况下,问题是当我们添加另一个库项目时,这些项目有一个 armeabi_v7 文件夹,所以显然 if 将优先于 armeabi 文件夹,这意味着不会找到 sqlitecypher 库。

In our case the solution was just to remove the armeabi_v7 folder on the new library.

在我们的例子中,解决方案只是删除新库上的 armeabi_v7 文件夹。

Hope it helps.

希望能帮助到你。

回答by Dharmik

I had same issue.. I was using Android Studio and I had imported application from eclipse to android studio.

我有同样的问题..我正在使用 Android Studio 并且我已将应用程序从 eclipse 导入到 android studio。

I spent 3-4 hours to find out the solution. Here what I did to solve this issue.. (Only for Android studio) Create Directory into srcfolder name it mainand other directory as per following image. You may have libs and assets folder outside of src folder, in main directory of project, that is eclipse structure. We will need to follow Android Studio's structure.. enter image description here

我花了 3-4 个小时来找出解决方案。这是我为解决此问题所做的工作..(仅适用于 Android Studio)将目录创建到src文件夹中,将其命名为main其他目录,如下图所示。您可能在 src 文件夹之外有 libs 和 assets 文件夹,在项目的主目录中,即 eclipse 结构。我们需要遵循 Android Studio 的结构.. 在此处输入图片说明

For more details.. Check thislink...

有关更多详细信息.. 检查链接...

For other helps regarding SqlCipher check thislink..

有关 SqlCipher 的其他帮助,请查看链接。

(I know I am bit late to answer this question but it might help someone.)

(我知道我回答这个问题有点晚,但它可能对某人有所帮助。)

回答by Vij Vijay

The loader is not able to find the said library file. So, I decided to pack it along with my app. It's only 394KB

加载程序无法找到所述库文件。所以,我决定将它与我的应用程序一起打包。它只有 394KB

I downloaded the libstlport_shared.so from the following address and added it to the lib/armeabi and lib/armeabi-v7a folders, cleaned the project and rebuilt it. Now it runs without a problem.

我从下面的地址下载了libstlport_shared.so,添加到lib/armeabi和lib/armeabi-v7a文件夹下,清理工程,重建。现在它运行没有问题。

http://331312256.wodemo.net/browse/dl/156348/lib/armeabi/libstlport_shared.so?resolved=1

http://331312256.wodemo.net/browse/dl/156348/lib/armeabi/libstlport_shared.so?resolved=1

Hope that helps

希望有帮助