rmtheis / android-ocr

Experimental optical character recognition app
Apache License 2.0
2.23k stars 894 forks source link

java.lang.ExceptionInInitializerError #18

Closed ghost closed 9 years ago

ghost commented 10 years ago

Hi,

I managed to get the lib files liblept.so and also libtess.so and put them in the folder armeabi-v7a, x86 and also armeabi alone, and i get the following exception:

09-18 14:20:10.579: E/AndroidRuntime(16612): java.lang.ExceptionInInitializerError 09-18 14:20:10.579: E/AndroidRuntime(16612): at edu.sfsu.cs.orange.ocr.CaptureActivity.initOcrEngine(CaptureActivity.java:711) 09-18 14:20:10.579: E/AndroidRuntime(16612): at edu.sfsu.cs.orange.ocr.CaptureActivity.onResume(CaptureActivity.java:368) 09-18 14:20:10.579: E/AndroidRuntime(16612): at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1189) 09-18 14:20:10.579: E/AndroidRuntime(16612): at android.app.Activity.performResume(Activity.java:5094) 09-18 14:20:10.579: E/AndroidRuntime(16612): at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2718) 09-18 14:20:10.579: E/AndroidRuntime(16612): at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2760) 09-18 14:20:10.579: E/AndroidRuntime(16612): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2216) 09-18 14:20:10.579: E/AndroidRuntime(16612): at android.app.ActivityThread.access$600(ActivityThread.java:149) 09-18 14:20:10.579: E/AndroidRuntime(16612): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1300) 09-18 14:20:10.579: E/AndroidRuntime(16612): at android.os.Handler.dispatchMessage(Handler.java:99) 09-18 14:20:10.579: E/AndroidRuntime(16612): at android.os.Looper.loop(Looper.java:153) 09-18 14:20:10.579: E/AndroidRuntime(16612): at android.app.ActivityThread.main(ActivityThread.java:5086) 09-18 14:20:10.579: E/AndroidRuntime(16612): at java.lang.reflect.Method.invokeNative(Native Method) 09-18 14:20:10.579: E/AndroidRuntime(16612): at java.lang.reflect.Method.invoke(Method.java:511) 09-18 14:20:10.579: E/AndroidRuntime(16612): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:821) 09-18 14:20:10.579: E/AndroidRuntime(16612): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:584) 09-18 14:20:10.579: E/AndroidRuntime(16612): at dalvik.system.NativeStart.main(Native Method) 09-18 14:20:10.579: E/AndroidRuntime(16612): Caused by: java.lang.NoSuchFieldError: no field with name='mNativeData' signature='I' in class Lcom/googlecode/tesseract/android/TessBaseAPI; 09-18 14:20:10.579: E/AndroidRuntime(16612): at com.googlecode.tesseract.android.TessBaseAPI.nativeClassInit(Native Method) 09-18 14:20:10.579: E/AndroidRuntime(16612): at com.googlecode.tesseract.android.TessBaseAPI.(TessBaseAPI.java:47) 09-18 14:20:10.579: E/AndroidRuntime(16612): ... 17 more

how do i solve this? Please assist.

rmtheis commented 9 years ago

Try referencing the tess-two project as a library project instead.

Ritika16 commented 9 years ago

I too am getting the same issue.. can you please help me out too

rmtheis commented 9 years ago

See http://stackoverflow.com/questions/30411185/tess-two-reciving-int-but-waiting-for-long