Search code examples
androidtesseracttess-two

tess-two can't find libpng.so


I have followed building instructions for tess-two on Github

I build tess-two using NDK successfully and imported the library I am trying to run the test application provided on the same repository but whenever the application starts it gives the following exception: That error is caused once new TessBaseAPI(); is called.

dlopen("/data/app-lib/com.datumdroid.android.ocr.simple-2/liblept.so") failed: Cannot load library: soinfo_link_image(linker.cpp:1635): could not load library "libpng.so" needed by "liblept.so"; caused by load_library(linker.cpp:745): library "libpng.so" not found

Can anyone help with that?


Solution

  • I have followed suggestion of Dmitry Zaitsev & thannks to him , solved my problem also .

    Please update your TessBaseAPI.java from tess-two library project as below :

       static {
            System.loadLibrary("png");
            System.loadLibrary("lept");
            System.loadLibrary("tess");
    
            nativeClassInit();
         }
    

    Build tess-two project after updating these file . In my case I have build it using eclipse. Hope it should solve your problem as well.