rmtheis / android-ocr

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

java.lang.RuntimeException: Unable to resume activity : CaptureActivity #47

Closed PrashantYadav closed 8 years ago

PrashantYadav commented 8 years ago

@rmtheis I am facing this issue on running the app.

This is my directory structure. I am trying to run on android studio 2.0 windows 10 (64 bit) machine. untitled

Here is stack trace 04-28 02:57:12.025 18385-18385/com.prashantskywalker.newvideoocr E/CaptureActivity: setdefaultpreferences run 04-28 02:57:17.199 18385-18393/com.prashantskywalker.newvideoocr W/art: Suspending all threads took: 8.531ms 04-28 02:57:17.223 18385-18385/com.prashantskywalker.newvideoocr W/art: Verification of java.lang.Object com.prashantskywalker.newvideoocr.ViewfinderView.access$super(com.prashantskywalker.newvideoocr.ViewfinderView, java.lang.String, java.lang.Object[]) took 502.418ms 04-28 02:57:17.310 18385-18385/com.prashantskywalker.newvideoocr W/ResourceType: Failure getting entry for 0x7f0d0003 (t=12 e=3) (error -75) 04-28 02:57:17.310 18385-18385/com.prashantskywalker.newvideoocr W/ResourceType: Failure getting entry for 0x7f0d0002 (t=12 e=2) (error -75) 04-28 02:57:17.311 18385-18385/com.prashantskywalker.newvideoocr D/AndroidRuntime: Shutting down VM 04-28 02:57:17.314 18385-18385/com.prashantskywalker.newvideoocr E/AndroidRuntime: FATAL EXCEPTION: main Process: com.prashantskywalker.newvideoocr, PID: 18385 java.lang.RuntimeException: Unable to resume activity {com.prashantskywalker.newvideoocr/com.prashantskywalker.newvideoocr.CaptureActivity}: android.view.InflateException: Binary XML file line #26: Error inflating class java.lang.reflect.Constructor at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3028) at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3063) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2418) at android.app.ActivityThread.access$800(ActivityThread.java:155) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1317) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5343) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:700) Caused by: android.view.InflateException: Binary XML file line #26: Error inflating class java.lang.reflect.Constructor at android.preference.GenericInflater.createItem(GenericInflater.java:397) at android.preference.GenericInflater.onCreateItem(GenericInflater.java:417) at android.preference.GenericInflater.createItemFromTag(GenericInflater.java:428) at android.preference.GenericInflater.rInflate(GenericInflater.java:481) at android.preference.GenericInflater.rInflate(GenericInflater.java:493) at android.preference.GenericInflater.inflate(GenericInflater.java:326) at android.preference.GenericInflater.inflate(GenericInflater.java:263) at android.preference.PreferenceManager.inflateFromResource(PreferenceManager.java:272) at android.preference.PreferenceManager.setDefaultValues(PreferenceManager.java:485) at android.preference.PreferenceManager.setDefaultValues(PreferenceManager.java:444) at com.prashantskywalker.newvideoocr.CaptureActivity.retrievePreferences(CaptureActivity.java:1146) at com.prashantskywalker.newvideoocr.CaptureActivity.onResume(CaptureActivity.java:392) at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1280) at android.app.Activity.performResume(Activity.java:6096) at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3011) at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3063)  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2418)  at android.app.ActivityThread.access$800(ActivityThread.java:155)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1317)  at android.os.Handler.dispatchMessage(Handler.java:102)  at android.os.Looper.loop(Looper.java:135)  at android.app.ActivityThread.main(ActivityThread.java:5343)  at java.lang.reflect.Method.invoke(Native Method)  at java.lang.reflect.Method.invoke(Method.java:372)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:700)  Caused by: java.lang.reflect.InvocationTargetException at java.lang.reflect.Constructor.newInstance(Native Method) at java.lang.reflect.Constructor.newInstance(Constructor.java:288) at android.preference.GenericInflater.createItem(GenericInflater.java:383) at android.preference.GenericInflater.onCreateItem(GenericInflater.java:417)  at android.preference.GenericInflater.createItemFromTag(GenericInflater.java:428)  at android.preference.GenericInflater.rInflate(GenericInflater.java:481)  at android.preference.GenericInflater.rInflate(GenericInflater.java:493)  at android.preference.GenericInflater.inflate(GenericInflater.java:326)  at android.preference.GenericInflater.inflate(GenericInflater.java:263)  at android.preference.PreferenceManager.inflateFromResource(PreferenceManager.java:272)  at android.preference.PreferenceManager.setDefaultValues(PreferenceManager.java:485)  at android.preference.PreferenceManager.setDefaultValues(PreferenceManager.java:444)  at com.prashantskywalker.newvideoocr.CaptureActivity.retrievePreferences(CaptureActivity.java:1146)  at com.prashantskywalker.newvideoocr.CaptureActivity.onResume(CaptureActivity.java:392)  at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1280)  at android.app.Activity.performResume(Activity.java:6096)  at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3011)  at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3063)  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2418)  at android.app.ActivityThread.access$800(ActivityThread.java:155)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1317)  at android.os.Handler.dispatchMessage(Handler.java:102)  at android.os.Looper.loop(Looper.java:135)  at android.app.ActivityThread.main(ActivityThread.java:5343)  at java.lang.reflect.Method.invoke(Native Method)  at java.lang.reflect.Method.invoke(Method.java:372)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:700)  Caused by: java.lang.NullPointerException: Attempt to get length of null array at android.content.res.AssetManager.getResourceTextArray(AssetManager.java:214) at android.content.res.Resources.getTextArray(Resources.java:503) at android.content.res.TypedArray.getTextArray(TypedArray.java:771) at android.preference.ListPreference.(ListPreference.java:51) at android.preference.ListPreference.(ListPreference.java:65) at android.preference.ListPreference.(ListPreference.java:69) at java.lang.reflect.Constructor.newInstance(Native Method)  at java.lang.reflect.Constructor.newInstance(Constructor.java:288)  at android.preference.GenericInflater.createItem(GenericInflater.java:383)  at android.preference.GenericInflater.onCreateItem(GenericInflater.java:417)  at android.preference.GenericInflater.createItemFromTag(GenericInflater.java:428)  at android.preference.GenericInflater.rInflate(GenericInflater.java:481)  at android.preference.GenericInflater.rInflate(GenericInflater.java:493)  at android.preference.GenericInflater.inflate(GenericInflater.java:326)  at android.preference.GenericInflater.inflate(GenericInflater.java:263)  at android.preference.PreferenceManager.inflateFromResource(PreferenceManager.java:272)  at android.preference.PreferenceManager.setDefaultValues(PreferenceManager.java:485)  at android.preference.PreferenceManager.setDefaultValues(PreferenceManager.java:444)  at com.prashantskywalker.newvideoocr.CaptureActivity.retrievePreferences(CaptureActivity.java:1146)  at com.prashantskywalker.newvideoocr.CaptureActivity.onResume(CaptureActivity.java:392)  at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1280)  at android.app.Activity.performResume(Activity.java:6096)  at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3011)  at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3063)  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2418)  at android.app.ActivityThread.access$800(ActivityThread.java:155)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1317)  at android.os.Handler.dispatchMessage(Handler.java:102)  at android.os.Looper.loop(Looper.java:135)  at android.app.ActivityThread.main(ActivityThread.java:5343)  at java.lang.reflect.Method.invoke(Native Method)  at java.lang.reflect.Method.invoke(Method.java:372)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:700)  04-28 02:57:18.354 18385-18385/com.prashantskywalker.newvideoocr I/Process: Sending signal. PID: 18385 SIG: 9 04-28 03:24:12.214 20903-20903/com.prashantskywalker.newvideoocr W/art: Failed to find OatDexFile for DexFile /data/data/com.prashantskywalker.newvideoocr/files/instant-run/dex/slice-slice_4-classes.dex ( canonical path /data/data/com.prashantskywalker.newvideoocr/files/instant-run/dex/slice-slice_4-classes.dex) with checksum 0x932b9786 in OatFile /data/data/com.prashantskywalker.newvideoocr/cache/slice-slice_4-classes.dex 04-28 03:24:14.219 20903-20903/com.prashantskywalker.newvideoocr W/ResourceType: Failure getting entry for 0x7f0d0003 (t=12 e=3) (error -75) 04-28 03:24:14.219 20903-20903/com.prashantskywalker.newvideoocr W/ResourceType: Failure getting entry for 0x7f0d0002 (t=12 e=2) (error -75) 04-28 03:24:14.220 20903-20903/com.prashantskywalker.newvideoocr D/AndroidRuntime: Shutting down VM 04-28 03:24:14.223 20903-20903/com.prashantskywalker.newvideoocr E/AndroidRuntime: FATAL EXCEPTION: main Process: com.prashantskywalker.newvideoocr, PID: 20903 java.lang.RuntimeException: Unable to resume activity {com.prashantskywalker.newvideoocr/com.prashantskywalker.newvideoocr.CaptureActivity}: android.view.InflateException: Binary XML file line #26: Error inflating class java.lang.reflect.Constructor at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3028) at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3063) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2418) at android.app.ActivityThread.access$800(ActivityThread.java:155) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1317) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5343) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:700) Caused by: android.view.InflateException: Binary XML file line #26: Error inflating class java.lang.reflect.Constructor at android.preference.GenericInflater.createItem(GenericInflater.java:397) at android.preference.GenericInflater.onCreateItem(GenericInflater.java:417) at android.preference.GenericInflater.createItemFromTag(GenericInflater.java:428) at android.preference.GenericInflater.rInflate(GenericInflater.java:481) at android.preference.GenericInflater.rInflate(GenericInflater.java:493) at android.preference.GenericInflater.inflate(GenericInflater.java:326) at android.preference.GenericInflater.inflate(GenericInflater.java:263) at android.preference.PreferenceManager.inflateFromResource(PreferenceManager.java:272) at android.preference.PreferenceManager.setDefaultValues(PreferenceManager.java:485) at android.preference.PreferenceManager.setDefaultValues(PreferenceManager.java:444) at com.prashantskywalker.newvideoocr.CaptureActivity.retrievePreferences(CaptureActivity.java:1146) at com.prashantskywalker.newvideoocr.CaptureActivity.onResume(CaptureActivity.java:392) at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1280) at android.app.Activity.performResume(Activity.java:6096) at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3011) at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3063)  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2418)  at android.app.ActivityThread.access$800(ActivityThread.java:155)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1317)  at android.os.Handler.dispatchMessage(Handler.java:102)  at android.os.Looper.loop(Looper.java:135)  at android.app.ActivityThread.main(ActivityThread.java:5343)  at java.lang.reflect.Method.invoke(Native Method)  at java.lang.reflect.Method.invoke(Method.java:372)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:700)  Caused by: java.lang.reflect.InvocationTargetException at java.lang.reflect.Constructor.newInstance(Native Method) at java.lang.reflect.Constructor.newInstance(Constructor.java:288) at android.preference.GenericInflater.createItem(GenericInflater.java:383) at android.preference.GenericInflater.onCreateItem(GenericInflater.java:417)  at android.preference.GenericInflater.createItemFromTag(GenericInflater.java:428)  at android.preference.GenericInflater.rInflate(GenericInflater.java:481)  at android.preference.GenericInflater.rInflate(GenericInflater.java:493)  at android.preference.GenericInflater.inflate(GenericInflater.java:326)  at android.preference.GenericInflater.inflate(GenericInflater.java:263)  at android.preference.PreferenceManager.inflateFromResource(PreferenceManager.java:272)  at android.preference.PreferenceManager.setDefaultValues(PreferenceManager.java:485)  at android.preference.PreferenceManager.setDefaultValues(PreferenceManager.java:444)  at com.prashantskywalker.newvideoocr.CaptureActivity.retrievePreferences(CaptureActivity.java:1146)  at com.prashantskywalker.newvideoocr.CaptureActivity.onResume(CaptureActivity.java:392)  at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1280)  at android.app.Activity.performResume(Activity.java:6096)  at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3011)  at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3063)  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2418)  at android.app.ActivityThread.access$800(ActivityThread.java:155)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1317)  at android.os.Handler.dispatchMessage(Handler.java:102)  at android.os.Looper.loop(Looper.java:135)  at android.app.ActivityThread.main(ActivityThread.java:5343)  at java.lang.reflect.Method.invoke(Native Method)  at java.lang.reflect.Method.invoke(Method.java:372)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:700)  Caused by: java.lang.NullPointerException: Attempt to get length of null array at android.content.res.AssetManager.getResourceTextArray(AssetManager.java:214) at android.content.res.Resources.getTextArray(Resources.java:503) at android.content.res.TypedArray.getTextArray(TypedArray.java:771) at android.preference.ListPreference.(ListPreference.java:51) at android.preference.ListPreference.(ListPreference.java:65) at android.preference.ListPreference.(ListPreference.java:69) at java.lang.reflect.Constructor.newInstance(Native Method)  at java.lang.reflect.Constructor.newInstance(Constructor.java:288)  at android.preference.GenericInflater.createItem(GenericInflater.java:383)  at android.preference.GenericInflater.onCreateItem(GenericInflater.java:417)  at android.preference.GenericInflater.createItemFromTag(GenericInflater.java:428)  at android.preference.GenericInflater.rInflate(GenericInflater.java:481)  at android.preference.GenericInflater.rInflate(GenericInflater.java:493)  at android.preference.GenericInflater.inflate(GenericInflater.java:326)  at android.preference.GenericInflater.inflate(GenericInflater.java:263)  at android.preference.PreferenceManager.inflateFromResource(PreferenceManager.java:272)  at android.preference.PreferenceManager.setDefaultValues(PreferenceManager.java:485)  at android.preference.PreferenceManager.setDefaultValues(PreferenceManager.java:444)  at com.prashantskywalker.newvideoocr.CaptureActivity.retrievePreferences(CaptureActivity.java:1146)  at com.prashantskywalker.newvideoocr.CaptureActivity.onResume(CaptureActivity.java:392)  at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1280)  at android.app.Activity.performResume(Activity.java:6096)  at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3011)  at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3063)  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2418)  at android.app.ActivityThread.access$800(ActivityThread.java:155)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1317)  at android.os.Handler.dispatchMessage(Handler.java:102)  at android.os.Looper.loop(Looper.java:135)  at android.app.ActivityThread.main(ActivityThread.java:5343)  at java.lang.reflect.Method.invoke(Native Method)  at java.lang.reflect.Method.invoke(Method.java:372)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:700)  04-28 03:34:38.754 22151-22151/com.prashantskywalker.newvideoocr W/ResourceType: Failure getting entry for 0x7f0d0003 (t=12 e=3) (error -75) 04-28 03:34:38.754 22151-22151/com.prashantskywalker.newvideoocr W/ResourceType: Failure getting entry for 0x7f0d0002 (t=12 e=2) (error -75) 04-28 03:34:38.755 22151-22151/com.prashantskywalker.newvideoocr D/AndroidRuntime: Shutting down VM 04-28 03:34:38.759 22151-22151/com.prashantskywalker.newvideoocr E/AndroidRuntime: FATAL EXCEPTION: main Process: com.prashantskywalker.newvideoocr, PID: 22151 java.lang.RuntimeException: Unable to resume activity {com.prashantskywalker.newvideoocr/com.prashantskywalker.newvideoocr.CaptureActivity}: android.view.InflateException: Binary XML file line #26: Error inflating class java.lang.reflect.Constructor at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3028) at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3063) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2418) at android.app.ActivityThread.access$800(ActivityThread.java:155) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1317) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5343) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:700) Caused by: android.view.InflateException: Binary XML file line #26: Error inflating class java.lang.reflect.Constructor at android.preference.GenericInflater.createItem(GenericInflater.java:397) at android.preference.GenericInflater.onCreateItem(GenericInflater.java:417) at android.preference.GenericInflater.createItemFromTag(GenericInflater.java:428) at android.preference.GenericInflater.rInflate(GenericInflater.java:481) at android.preference.GenericInflater.rInflate(GenericInflater.java:493) at android.preference.GenericInflater.inflate(GenericInflater.java:326) at android.preference.GenericInflater.inflate(GenericInflater.java:263) at android.preference.PreferenceManager.inflateFromResource(PreferenceManager.java:272) at android.preference.PreferenceManager.setDefaultValues(PreferenceManager.java:485) at android.preference.PreferenceManager.setDefaultValues(PreferenceManager.java:444) at com.prashantskywalker.newvideoocr.CaptureActivity.retrievePreferences(CaptureActivity.java:1146) at com.prashantskywalker.newvideoocr.CaptureActivity.onResume(CaptureActivity.java:392) at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1280) at android.app.Activity.performResume(Activity.java:6096) at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3011) at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3063)  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2418)  at android.app.ActivityThread.access$800(ActivityThread.java:155)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1317)  at android.os.Handler.dispatchMessage(Handler.java:102)  at android.os.Looper.loop(Looper.java:135)  at android.app.ActivityThread.main(ActivityThread.java:5343)  at java.lang.reflect.Method.invoke(Native Method)  at java.lang.reflect.Method.invoke(Method.java:372)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:700)  Caused by: java.lang.reflect.InvocationTargetException at java.lang.reflect.Constructor.newInstance(Native Method) at java.lang.reflect.Constructor.newInstance(Constructor.java:288) at android.preference.GenericInflater.createItem(GenericInflater.java:383) at android.preference.GenericInflater.onCreateItem(GenericInflater.java:417)  at android.preference.GenericInflater.createItemFromTag(GenericInflater.java:428)  at android.preference.GenericInflater.rInflate(GenericInflater.java:481)  at android.preference.GenericInflater.rInflate(GenericInflater.java:493)  at android.preference.GenericInflater.inflate(GenericInflater.java:326)  at android.preference.GenericInflater.inflate(GenericInflater.java:263)  at android.preference.PreferenceManager.inflateFromResource(PreferenceManager.java:272)  at android.preference.PreferenceManager.setDefaultValues(PreferenceManager.java:485)  at android.preference.PreferenceManager.setDefaultValues(PreferenceManager.java:444)  at com.prashantskywalker.newvideoocr.CaptureActivity.retrievePreferences(CaptureActivity.java:1146)  at com.prashantskywalker.newvideoocr.CaptureActivity.onResume(CaptureActivity.java:392)  at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1280)  at android.app.Activity.performResume(Activity.java:6096)  at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3011)  at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3063)  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2418)  at android.app.ActivityThread.access$800(ActivityThread.java:155)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1317)  at android.os.Handler.dispatchMessage(Handler.java:102)  at android.os.Looper.loop(Looper.java:135)  at android.app.ActivityThread.main(ActivityThread.java:5343)  at java.lang.reflect.Method.invoke(Native Method)  at java.lang.reflect.Method.invoke(Method.java:372)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:700)  Caused by: java.lang.NullPointerException: Attempt to get length of null array at android.content.res.AssetManager.getResourceTextArray(AssetManager.java:214) at android.content.res.Resources.getTextArray(Resources.java:503) at android.content.res.TypedArray.getTextArray(TypedArray.java:771) at android.preference.ListPreference.(ListPreference.java:51) at android.preference.ListPreference.(ListPreference.java:65) at android.preference.ListPreference.(ListPreference.java:69) at java.lang.reflect.Constructor.newInstance(Native Method)  at java.lang.reflect.Constructor.newInstance(Constructor.java:288)  at android.preference.GenericInflater.createItem(GenericInflater.java:383)  at android.preference.GenericInflater.onCreateItem(GenericInflater.java:417)  at android.preference.GenericInflater.createItemFromTag(GenericInflater.java:428)  at android.preference.GenericInflater.rInflate(GenericInflater.java:481)  at android.preference.GenericInflater.rInflate(GenericInflater.java:493)  at android.preference.GenericInflater.inflate(GenericInflater.java:326)  at android.preference.GenericInflater.inflate(GenericInflater.java:263)  at android.preference.PreferenceManager.inflateFromResource(PreferenceManager.java:272)  at android.preference.PreferenceManager.setDefaultValues(PreferenceManager.java:485)  at android.preference.PreferenceManager.setDefaultValues(PreferenceManager.java:444)  at com.prashantskywalker.newvideoocr.CaptureActivity.retrievePreferences(CaptureActivity.java:1146)  at com.prashantskywalker.newvideoocr.CaptureActivity.onResume(CaptureActivity.java:392)  at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1280)  at android.app.Activity.performResume(Activity.java:6096)  at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3011)  at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3063)  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2418)  at android.app.ActivityThread.access$800(ActivityThread.java:155)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1317)  at android.os.Handler.dispatchMessage(Handler.java:102)  at android.os.Looper.loop(Looper.java:135)  at android.app.ActivityThread.main(ActivityThread.java:5343)  at java.lang.reflect.Method.invoke(Native Method)  at java.lang.reflect.Method.invoke(Method.java:372)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:700)  04-28 03:34:40.587 22151-22151/com.prashantskywalker.newvideoocr I/Process: Sending signal. PID: 22151 SIG: 9

rmtheis commented 8 years ago

This looks like it's due to something you've changed yourself. Please reopen if you can provide steps to reproduce using the unmodified code from this project, and include what version of Android you're running on.

PrashantYadav commented 8 years ago

Hi @rmtheis thanks for replying. I have not changed anything except package name. I am trying to run it on moto e device (android 5.1). I also download your app from google play store, and it was running awesomely. The accuracy was also very good.

I followed the instructions from here: http://gaut.am/making-an-ocr-android-app-using-tesseract/#comment-184181

Steps -

  1. created a new project in android studio.
  2. installed the ndk.
  3. downloaded the tess-two-master library from github
  4. built and added it as tess-two as module dependency in the project.
  5. downloaded android-ocr and added all the java, res and all other files to the project.
  6. changed the package name in the files.
  7. tried to run it and found the following error impeding any further progress.
rmtheis commented 8 years ago

Did you also update the package name in the XML at https://github.com/rmtheis/android-ocr/blob/master/OCRTest/src/main/res/layout/capture.xml#L27?

PrashantYadav commented 8 years ago

Yes, i had updated it. Can the problem be in preferences xml file as can be seen in stack trace.

rmtheis commented 8 years ago

Those instructions are unnecessary. Try just importing the project and clicking the run button.

PrashantYadav commented 8 years ago

Hi @rmtheis , I directly imported the project and its running. But there is a small problem. I am not able to see setting button as was in the Play store app for continuous mode. What can be the problem ?

rmtheis commented 8 years ago

If you didn't change the targetSdkVersion then your phone probably has it mapped to a long press on the lower left button on the handset.