UnsatisfiedLinkError when trying to create new instance of TessBaseAPI

Viewed 150

This is a weird error because it doesn't happen every time - mostly rare - so it's difficult to debug. This is the line where the error occurs:

TessBaseAPI tessBaseApi = new TessBaseAPI();  

I use this library to connect Tesseract with Android.

The error log:

E/linker: package com.app.myapp: library "/system/lib64/libjpeg.so" ("/system/lib64/libjpeg.so") needed or dlopened by "/system/lib64/libnativeloader.so" is not accessible for the namespace: [name="classloader-namespace", ld_library_paths="", default_library_paths="/data/app/com.app.myapp-4EcKvX8ZmvEUrqVJAF20Dg==/lib/arm64:/data/app/com.app.myapp-4EcKvX8ZmvEUrqVJAF20Dg==/base.apk!/lib/arm64-v8a", permitted_paths="/data:/mnt/expand:/mnt/asec:/data/data/com.app.myapp"] D/AndroidRuntime: Shutting down VM E/AndroidRuntime: FATAL EXCEPTION: main Process: com.app.myapp, PID: 6393 java.lang.UnsatisfiedLinkError: dlopen failed: library "/system/lib64/libjpeg.so" needed or dlopened by "/system/lib64/libnativeloader.so" is not accessible for the namespace "classloader-namespace" at java.lang.Runtime.loadLibrary0(Runtime.java:1016) at java.lang.System.loadLibrary(System.java:1657) at com.googlecode.tesseract.android.TessBaseAPI.(TessBaseAPI.java:52) at com.app.myapp.utils.UtilsOCR.getTessBaseAPI(UtilsOCR.java:257) at com.app.myapp.ocr.OCRTextEvaluator.init(OCRTextEvaluator.java:381) at com.app.myapp.ocr.OCRTextEvaluator.(OCRTextEvaluator.java:48) at com.app.myapp.helper.NotebookWriter.init(NotebookWriter.java:530) at com.app.myapp.helper.NotebookWriter.(NotebookWriter.java:89)

Inside TessBaseAPI class the error occurs in this line:

System.loadLibrary("jpeg");

Any kind of help would be appreciated.

0 Answers
Related