rmtheis / tess-two

Fork of Tesseract Tools for Android
Apache License 2.0
3.76k stars 1.38k forks source link

No JNI_OnLoad found in /data/app-lib/****/libjpgt.so 0x43738aa0, skipping init #237

Closed zhangjiatw closed 6 years ago

zhangjiatw commented 6 years ago

Summary: The code was working very good in Jan 2018, and everything was right. But when I want to rebuild again at today(14th, March), its show the following error, I never change anything since successful to build last time.

D/dalvikvm: Trying to load lib /data/app-lib//libjpgt.so 0x43738aa0 D/dalvikvm: Added shared lib /data/app-lib//libjpgt.so 0x43738aa0 D/dalvikvm: No JNI_OnLoad found in /data/app-lib//libjpgt.so 0x43738aa0, skipping init D/dalvikvm: Trying to load lib /data/app-lib//libpngt.so 0x43738aa0 D/dalvikvm: Added shared lib /data/app-lib//libpngt.so 0x43738aa0 D/dalvikvm: No JNI_OnLoad found in /data/app-lib//libpngt.so 0x43738aa0, skipping init D/dalvikvm: Trying to load lib /data/app-lib//liblept.so 0x43738aa0 D/dalvikvm: Added shared lib /data/app-lib//liblept.so 0x43738aa0 D/dalvikvm: Trying to load lib /data/app-lib//libtess.so 0x43738aa0 D/dalvikvm: Added shared lib /data/app-lib//libtess.so 0x43738aa0 Application terminated.

gradle: android { compileSdkVersion 26 defaultConfig { applicationId "com.alpha.ntnu.arbook" minSdkVersion 19 targetSdkVersion 26 versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } useLibrary 'org.apache.http.legacy' } dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation 'com.android.support.constraint:constraint-layout:1.0.2' testImplementation 'junit:junit:4.12' androidTestImplementation 'com.android.support.test:runner:1.0.1' androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1' compile 'com.rmtheis:tess-two:6.0.3' compile 'com.android.support:appcompat-v7:26.1.0' }

Tess-two version: 8.0.0

Android version: 4.4.4 / 7.1.1

zhangjiatw commented 6 years ago

mTess = new TessBaseAPI(new TessBaseAPI.ProgressNotifier() { public void onProgressValues(TessBaseAPI.ProgressValues progressValues) { pbScan.setProgress(progressValues.getPercent()); } }); mTess.setPageSegMode(7); //mTess.init(datapath, lang, TessBaseAPI.OEM_TESSERACT_ONLY);

When run mTess.init, application terminated and show the following error:

03-15 23:32:11.950 471-25177/? E/mm-camera: mct_pipeline_get_stream: no children 03-15 23:32:11.950 471-25177/? E/mm-camera: mct_pipeline_process_set:1350: Couldn't find stream 03-15 23:32:11.950 471-25775/? E/hdr: Session id 0x1 stopped 03-15 23:32:12.020 805-828/? E/Diag_Lib: [IMS_FATAL]| 2912 | 828 |ims-rtp-daemon ims_rtp_qmi_handler_thread_func waiting on select thread>

rmtheis commented 6 years ago

Hmm, can you post what the actual error message was? No JNI_OnLoad found is just a warning -- it's not an error.

Also, your build.gradle code says you're using version 6.0.3, but your comment says you're using version 8.0.0. Which version has the problem?

zhangjiatw commented 6 years ago

Dear rmtheis

Thank you for your prompt reply and assistance. I'm trying to used version 6.0.3 because 8.0.0 cause this issue, but not working both. I'm recording the video as follows: https://www.youtube.com/watch?v=f4Eft948c3Y My phone has shown nothing, and there was no other error message.

Here is all I have: 03-16 15:55:27.574 27910-27910/? D/dalvikvm: Late-enabling CheckJNI 03-16 15:55:27.624 27910-27910/com..arbook W/ResourceType: CREATING STRING CACHE OF 44 bytes 03-16 15:55:27.644 27910-27910/com..arbook V/WebViewChromiumFactoryProvider: Binding Chromium to main looper Looper (main, tid 1) {4372d398} 03-16 15:55:27.644 27910-27910/com..arbook I/LibraryLoader: Expected native library version number "",actual native library version number "" 03-16 15:55:27.644 27910-27910/com..arbook I/chromium: [INFO:library_loader_hooks.cc(116)] Chromium logging enabled: level = 0, default verbosity = 0 03-16 15:55:27.644 27910-27910/com..arbook I/BrowserStartupController: Initializing chromium process, renderers=0 03-16 15:55:27.654 27910-27910/com..arbook E/AudioManagerAndroid: BLUETOOTH permission is missing! 03-16 15:55:27.664 27910-27910/com..arbook I/Adreno-EGL: : EGL 1.4 QUALCOMM build: () OpenGL ES Shader Compiler Version: E031.24.00.07 Build Date: 04/07/14 Mon Local Branch: au011 Remote Branch: Local Patches: Reconstruct Branch: 03-16 15:55:27.714 27910-27931/com..arbook W/chromium: [WARNING:proxy_service.cc(890)] PAC support disabled because there is no system implementation 03-16 15:55:27.734 27910-27910/com..arbook D/dalvikvm: Trying to load lib /data/app-lib/com..arbook-2/libjpgt.so 0x43732d68 03-16 15:55:27.734 27910-27910/com..arbook D/dalvikvm: Added shared lib /data/app-lib/com..arbook-2/libjpgt.so 0x43732d68 03-16 15:55:27.734 27910-27910/com..arbook D/dalvikvm: No JNI_OnLoad found in /data/app-lib/com..arbook-2/libjpgt.so 0x43732d68, skipping init 03-16 15:55:27.734 27910-27910/com..arbook D/dalvikvm: Trying to load lib /data/app-lib/com..arbook-2/libpngt.so 0x43732d68 03-16 15:55:27.734 27910-27910/com..arbook D/dalvikvm: Added shared lib /data/app-lib/com..arbook-2/libpngt.so 0x43732d68 03-16 15:55:27.734 27910-27910/com..arbook D/dalvikvm: No JNI_OnLoad found in /data/app-lib/com..arbook-2/libpngt.so 0x43732d68, skipping init 03-16 15:55:27.744 27910-27910/com..arbook D/dalvikvm: Trying to load lib /data/app-lib/com..arbook-2/liblept.so 0x43732d68 03-16 15:55:27.744 27910-27910/com..arbook D/dalvikvm: Added shared lib /data/app-lib/com..arbook-2/liblept.so 0x43732d68 03-16 15:55:27.744 27910-27910/com..arbook D/dalvikvm: Trying to load lib /data/app-lib/com..arbook-2/libtess.so 0x43732d68 03-16 15:55:27.804 27910-27910/com..arbook D/dalvikvm: Added shared lib /data/app-lib/com..arbook-2/libtess.so 0x43732d68

And my gradle: apply plugin: 'com.android.application' android { compileSdkVersion 26 defaultConfig { applicationId "com.***.arbook" minSdkVersion 19 targetSdkVersion 26 versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } useLibrary 'org.apache.http.legacy' } dependencies { implementation fileTree(dir: 'libs', include: ['.jar']) implementation 'com.android.support.constraint:constraint-layout:1.0.2' testImplementation 'junit:junit:4.12' androidTestImplementation 'com.android.support.test:runner:1.0.1' androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1' compile 'com.rmtheis:tess-two:8.0.0' compile 'com.android.support:appcompat-v7:26.1.0' }

The point is, everything was fine and work very well at Jan, and I didn't change any setting and code. :-(

zhangjiatw commented 6 years ago

I try to used another device and get new Error message as follows:

03/16 16:23:41: Launching app $ adb push C:\Users\newgalaxy\Desktop\ARDict_180119TC_clickVer_newbuild\app\build\outputs\apk\debug\app-debug.apk /data/local/tmp/com.alpha.ntnu.arbook $ adb shell pm install -t -r "/data/local/tmp/com.alpha.ntnu.arbook" pkg: /data/local/tmp/com.alpha.ntnu.arbook Success

$ adb shell am start -n "com.alpha.ntnu.arbook/com.alpha.ntnu.arbook.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER Client not ready yet..Connected to process 22354 on device sony-c6802-EP7327J6V7 Capturing and displaying logcat messages from application. This behavior can be disabled in the "Logcat output" section of the "Debugger" settings page. I/WebViewFactory: Loading com.google.android.webview version 44.0.2403.117 (code 240311700) W/ResourceType: Found multiple library tables, ignoring... W/ResourceType: Found multiple library tables, ignoring... I/LibraryLoader: Time to load native libraries: 1 ms (timestamps 6161-6162) I/LibraryLoader: Expected native library version number "",actual native library version number "" W/ResourceType: Found multiple library tables, ignoring... V/WebViewChromiumFactoryProvider: Binding Chromium to main looper Looper (main, tid 1) {2f70528f} I/LibraryLoader: Expected native library version number "",actual native library version number "" I/chromium: [INFO:library_loader_hooks.cc(120)] Chromium logging enabled: level = 0, default verbosity = 0 I/BrowserStartupController: Initializing chromium process, singleProcess=true W/art: Attempt to remove local handle scope entry from IRT, ignoring E/SysUtils: ApplicationContext is null in ApplicationStatus W/chromium: [WARNING:resource_bundle.cc(285)] locale_file_path.empty() E/libEGL: validate_display:255 error 3008 (EGL_BAD_DISPLAY) E/libEGL: validate_display:255 error 3008 (EGL_BAD_DISPLAY) I/Adreno-EGL: : EGL 1.4 QUALCOMM build: AU_LINUX_ANDROID_LA.BF.1.1.1_RB1.05.01.00.042.030_msm8974_LA.BF.1.1.1_RB1__release_AU () OpenGL ES Shader Compiler Version: E031.25.03.06 Build Date: 05/17/15 Sun Local Branch: mybranch10089422 Remote Branch: quic/LA.BF.1.1.1_rb1.22 Local Patches: NONE Reconstruct Branch: AU_LINUX_ANDROID_LA.BF.1.1.1_RB1.05.01.00.042.030 + 6151be1 + NOTHING D/BluetoothAdapter: 54418630: getState() : mService = null. Returning STATE_OFF W/art: Attempt to remove local handle scope entry from IRT, ignoring W/AwContents: onDetachedFromWindow called when already detached. Ignoring W/linker: libjpgt.so: unused DT entry: type 0x6ffffffe arg 0x2c94 W/linker: libjpgt.so: unused DT entry: type 0x6fffffff arg 0x1 W/linker: libpngt.so: unused DT entry: type 0x6ffffffe arg 0x530c W/linker: libpngt.so: unused DT entry: type 0x6fffffff arg 0x2 W/linker: liblept.so: unused DT entry: type 0x6ffffffe arg 0x1f8b0 W/linker: liblept.so: unused DT entry: type 0x6fffffff arg 0x2 W/linker: libtess.so: unused DT entry: type 0x6ffffffe arg 0x6c910 W/linker: libtess.so: unused DT entry: type 0x6fffffff arg 0x2 Application terminated.

zhangjiatw commented 6 years ago

Update:

I try to move "mTess.init(datapath, lang, TessBaseAPI.OEM_TESSERACT_ONLY);" to a button, and when running this command, application terminated without any error message like this:

. . . . D/skia: onFlyCompress D/dalvikvm: GC_FOR_ALLOC freed 458K, 13% free 37435K/42948K, paused 14ms, total 14ms D/dalvikvm: GC_FOR_ALLOC freed 1K, 11% free 38634K/42948K, paused 14ms, total 14ms D/skia: onFlyCompress D/skia: onFlyCompress Application terminated.

I tried the version from 8.0.0 to 6.0.3 and got the same result.

Also, I tried to used NDK to build .so and import com.googlecode.* to my project instead of external libraries, and the problem still.

rmtheis commented 6 years ago

Thanks for your willingness to report this. A few suggestions to try:

(1) Do you get the same result when you run on an emulator?

(2) Which unit test fails when you run the unit tests?

(3) Would it be possible to create a Github project that minimally demonstrates the issue so I can run it to reproduce the issue? Ideally that project would not include the extraneous code for your webview, StrictMode, etc.

rmtheis commented 6 years ago

As-is, I can't reproduce this issue. If in the future you're able to isolate the source of this issue, please reopen the issue.