Closed bendspoons closed 4 years ago
A bit more info:
2020-02-13 23:12:31.669 13614-13614/com.app.documentscanner D/ActivityThread: add activity client record, r= ActivityRecord{dc0ce4d token=android.os.BinderProxy@ae1139c {com.app.documentscanner/com.app.documentscanner.MainActivity}} token= android.os.BinderProxy@ae1139c 2020-02-13 23:12:31.671 13614-13614/com.app.documentscanner D/CordovaActivity: Started the activity. 2020-02-13 23:12:31.676 13614-13614/com.app.documentscanner D/CordovaActivity: Incoming Result. Request code = 99 2020-02-13 23:12:31.678 13614-13614/com.app.documentscanner D/CordovaInterfaceImpl: Sending activity result to plugin 2020-02-13 23:12:31.679 13614-13614/com.app.documentscanner I/BlockMonitor: dispatchingThrewException In MainThread 2020-02-13 23:12:31.679 13614-13614/com.app.documentscanner D/AndroidRuntime: Shutting down VM 2020-02-13 23:12:31.680 13614-13614/com.app.documentscanner I/QarthLog: [PatchStore] createDisableExceptionQarthFile 2020-02-13 23:12:31.680 13614-13614/com.app.documentscanner I/QarthLog: [PatchStore] create disable file for com.app.documentscanner uid is 10618
I think it has something to do with the Resukt and the request code. When i uncommented Line 108 in Scan.java
this.callbackContext.error("Incorrect result or user canceled the action.");
The app still crashes, but is reopened from start.
After some slightly deeper digging, i encountered this Info:
2020-02-13 23:27:34.008 18681-18681/com.app.documentscanner W/MediaStore: Failed to insert image java.lang.NullPointerException at java.util.Objects.requireNonNull(Objects.java:203) at android.provider.MediaStore$PendingSession.<init>(MediaStore.java:765) at android.provider.MediaStore.openPending(MediaStore.java:639) at android.provider.MediaStore$Images$Media.insertImage(MediaStore.java:1796) at com.scanlibrary.Utils.getUri(Utils.java:23) at com.scanlibrary.PickImageFragment.postImagePick(PickImageFragment.java:373) at com.scanlibrary.PickImageFragment.onActivityResult(PickImageFragment.java:368) at android.app.Activity.dispatchActivityResult(Activity.java:8420) at android.app.ActivityThread.deliverResults(ActivityThread.java:5442) at android.app.ActivityThread.handleSendResult(ActivityThread.java:5490) at android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:51) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:149) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:103) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2373) at android.os.Handler.dispatchMessage(Handler.java:107) at android.os.Looper.loop(Looper.java:213) at android.app.ActivityThread.main(ActivityThread.java:8147) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1101)
Som maybe it has something to do with the Android Scanner library itself?
I googled a bit, and found this on StackOverflow
Whcih mentions to replace
String path = MediaStore.Media.insertImage(context.getContentResolver(),bitmap,"Title",null);
with
ContentValues values=new ContentValues(); values.put(MediaStore.Images.Media.TITLE,"Title"); values.put(MediaStore.Images.Media.DESCRIPTION,"From Camera"); Uri path=getContentResolver().insert(MediaStore.Images.Media.EXTERNAL_CONTENT_URI,values);
But unfortunately im not that familiar with jar files or how to compile th Android Scanner Lirbary to a jar file with thos changes... if anybody could help me with either would be great :)
Is Android 10 (Q) so rare, or am i the only one experiencing this Error?!??
Hey @bendspoons Sorry I could not respond earlier. If you would like to contribute, then you can make the required changes in the scanlibrary.
And to make sure you are using your fork of the scan library, make sure you change the build.gradle (similar to this) in your fork of the plugin to use SNAPSHOT and also change the repo it targets (Yours if you are planning to fork).
I will try and get on this as and when time permits, but for now all I can do is point you in the right direction.
Still crashes with v4.2.5. I get "incorrect result or user canceled action" every time.
function successCallback(imageData) {
var image = document.getElementById('myImage');
image.src = "data:image/jpeg;base64," + imageData;
}
function errorCallback(message) {
alert('Failed because: ' + message);
}
scan.scanDoc(successCallback, errorCallback, {returnBase64 : true});
Works perfectly in the iOS version of my App but not Android. If I set sourceType:0
, it will open an image and no error message.
UPDATE:
Here are the error messages:
2020-06-18 12:35:50.944 6438-6521/com.vetcalculators.android E/eglCodecCommon: glUtilsParamSize: unknow param 0x000085b5
2020-06-18 12:35:50.944 6438-6521/com.vetcalculators.android E/eglCodecCommon: glUtilsParamSize: unknow param 0x000085b5
2020-06-18 12:35:50.993 6438-6521/com.vetcalculators.android E/eglCodecCommon: glUtilsParamSize: unknow param 0x000085b5
2020-06-18 12:35:50.993 6438-6521/com.vetcalculators.android E/eglCodecCommon: glUtilsParamSize: unknow param 0x000085b5
2020-06-18 12:35:51.026 1584-1603/? E/OMXNodeInstance: getConfig(0xe8520ea0:google.vorbis.decoder, ConfigAndroidVendorExtension(0x6f100004)) ERROR: Undefined(0x80001001)
2020-06-18 12:35:51.042 6438-6521/com.vetcalculators.android E/eglCodecCommon: glUtilsParamSize: unknow param 0x000085b5
2020-06-18 12:35:51.042 6438-6521/com.vetcalculators.android E/eglCodecCommon: glUtilsParamSize: unknow param 0x000085b5
2020-06-18 12:35:51.096 6438-6521/com.vetcalculators.android E/eglCodecCommon: glUtilsParamSize: unknow param 0x000085b5
2020-06-18 12:35:51.096 6438-6521/com.vetcalculators.android E/eglCodecCommon: glUtilsParamSize: unknow param 0x000085b5
2020-06-18 12:35:51.184 1452-1485/? E/SurfaceFlinger: ro.sf.lcd_density must be defined as a build property
2020-06-18 12:35:51.194 1716-5254/system_process E/memtrack: Couldn't load memtrack module
2020-06-18 12:35:51.246 1452-1799/? E/SurfaceFlinger: ro.sf.lcd_density must be defined as a build property
2020-06-18 12:35:51.305 7028-7028/com.android.camera2 E/CAM_StateMachine: Failed to process event: com.android.camera.captureintent.event.EventOnSurfaceTextureAvailable@e647e3e
2020-06-18 12:35:51.305 7028-7028/com.android.camera2 E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.android.camera2, PID: 7028
java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String com.android.camera.device.CameraId.getValue()' on a null object reference
at com.android.camera.one.v2.Camera2OneCameraManagerImpl.getCameraCharacteristics(Camera2OneCameraManagerImpl.java:117)
at com.android.camera.one.v2.Camera2OneCameraManagerImpl.getOneCameraCharacteristics(Camera2OneCameraManagerImpl.java:110)
at com.android.camera.captureintent.state.StateForegroundWithSurfaceTexture.onEnter(StateForegroundWithSurfaceTexture.java:71)
at com.android.camera.captureintent.stateful.StateMachineImpl.jumpToState(StateMachineImpl.java:62)
at com.android.camera.captureintent.stateful.StateMachineImpl.processEvent(StateMachineImpl.java:110)
at com.android.camera.captureintent.CaptureIntentModule$2.onSurfaceTextureAvailable(CaptureIntentModule.java:289)
at com.android.camera.app.CameraAppUI.onSurfaceTextureAvailable(CameraAppUI.java:1709)
at com.android.camera.TextureViewHelper.onSurfaceTextureAvailable(TextureViewHelper.java:471)
at android.view.TextureView.getHardwareLayer(TextureView.java:390)
at android.view.TextureView.draw(TextureView.java:339)
at android.view.View.updateDisplayListIfDirty(View.java:18142)
at android.view.View.draw(View.java:18920)
at android.view.ViewGroup.drawChild(ViewGroup.java:4236)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4022)
at android.view.View.draw(View.java:19195)
at android.view.View.updateDisplayListIfDirty(View.java:18142)
at android.view.View.draw(View.java:18920)
at android.view.ViewGroup.drawChild(ViewGroup.java:4236)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4022)
at android.view.View.updateDisplayListIfDirty(View.java:18133)
at android.view.View.draw(View.java:18920)
at android.view.ViewGroup.drawChild(ViewGroup.java:4236)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4022)
at android.view.View.updateDisplayListIfDirty(View.java:18133)
at android.view.View.draw(View.java:18920)
at android.view.ViewGroup.drawChild(ViewGroup.java:4236)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4022)
at android.view.View.updateDisplayListIfDirty(View.java:18133)
at android.view.View.draw(View.java:18920)
at android.view.ViewGroup.drawChild(ViewGroup.java:4236)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4022)
at android.view.View.draw(View.java:19195)
at com.android.internal.policy.DecorView.draw(DecorView.java:788)
at android.view.View.updateDisplayListIfDirty(View.java:18142)
at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:669)
at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:675)
at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:783)
at android.view.ViewRootImpl.draw(ViewRootImpl.java:2992)
at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2806)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2359)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1392)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6752)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:911)
at android.view.Choreographer.doCallbacks(Choreographer.java:723)
at android.view.Choreographer.doFrame(Choreographer.java:658)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:897)
at android.os.Handler.handleCallback(Handler.java:790)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6494)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
2020-06-18 12:35:52.004 6438-6521/com.vetcalculators.android E/eglCodecCommon: glUtilsParamSize: unknow param 0x000085b5
2020-06-18 12:35:52.004 6438-6521/com.vetcalculators.android E/eglCodecCommon: glUtilsParamSize: unknow param 0x000085b5
2020-06-18 12:35:53.467 6438-6521/com.vetcalculators.android E/eglCodecCommon: glUtilsParamSize: unknow param 0x000085b5
2020-06-18 12:35:53.544 6438-6521/com.vetcalculators.android E/eglCodecCommon: glUtilsParamSize: unknow param 0x000085b5
2020-06-18 12:35:53.578 6438-6521/com.vetcalculators.android E/eglCodecCommon: glUtilsParamSize: unknow param 0x000085b5
2020-06-18 12:35:53.713 6438-6521/com.vetcalculators.android E/eglCodecCommon: glUtilsParamSize: unknow param 0x000085b5
2020-06-18 12:35:53.755 6438-6521/com.vetcalculators.android E/eglCodecCommon: glUtilsParamSize: unknow param 0x000085b5
2020-06-18 12:35:53.755 6438-6521/com.vetcalculators.android E/eglCodecCommon: glUtilsParamSize: unknow param 0x000085b5
2020-06-18 12:35:53.801 6438-6521/com.vetcalculators.android E/eglCodecCommon: glUtilsParamSize: unknow param 0x000085b5
2020-06-18 12:35:53.801 6438-6521/com.vetcalculators.android E/eglCodecCommon: glUtilsParamSize: unknow param 0x000085b5
2020-06-18 12:35:54.311 1716-1833/system_process E/TaskPersister: File error accessing recents directory (directory doesn't exist?).
2020-06-18 12:35:56.843 6438-6521/com.vetcalculators.android E/eglCodecCommon: glUtilsParamSize: unknow param 0x000085b5
2020-06-18 12:35:56.994 6438-6521/com.vetcalculators.android E/eglCodecCommon: glUtilsParamSize: unknow param 0x000085b5
2020-06-18 12:35:57.024 6438-6521/com.vetcalculators.android E/eglCodecCommon: glUtilsParamSize: unknow param 0x000085b5
2020-06-18 12:35:57.197 6438-6521/com.vetcalculators.android E/eglCodecCommon: glUtilsParamSize: unknow param 0x000085b5
2020-06-18 12:35:57.226 6438-6521/com.vetcalculators.android E/eglCodecCommon: glUtilsParamSize: unknow param 0x000085b5
2020-06-18 12:35:57.226 6438-6521/com.vetcalculators.android E/eglCodecCommon: glUtilsParamSize: unknow param 0x000085b5
2020-06-18 12:35:57.695 1716-1833/system_process E/TaskPersister: File error accessing recents directory (directory doesn't exist?).
After my Update to Android 10 (Huawei mate 20) the Document Scanner crashes after ive taken a Photo. The same App, running on a Huawei P20 with Android 9 works well.
Installed Plugin with target and build SDK to 29, Android@7.1.4
Error
2020-02-13 22:37:37.742 5876-5876/com.app.documentscanner E/AndroidRuntime: FATAL EXCEPTION: main Process: com.app.documentscanner, PID: 5876 java.lang.RuntimeException: Unable to resume activity {com.app.documentscanner/com.app.documentscanner.MainActivity}: java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=99, result=0, data=null} to activity {com.app.documentscanner/com.app.documentscanner.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void org.apache.cordova.CallbackContext.error(java.lang.String)' on a null object reference at android.app.ActivityThread.performResumeActivity(ActivityThread.java:4767) at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:4810) at android.app.servertransaction.ResumeActivityItem.execute(ResumeActivityItem.java:52) at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:190) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:105) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2373) at android.os.Handler.dispatchMessage(Handler.java:107) at android.os.Looper.loop(Looper.java:213) at android.app.ActivityThread.main(ActivityThread.java:8147) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1101) Caused by: java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=99, result=0, data=null} to activity {com.app.documentscanner/com.app.documentscanner.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void org.apache.cordova.CallbackContext.error(java.lang.String)' on a null object reference at android.app.ActivityThread.deliverResults(ActivityThread.java:5449) at android.app.ActivityThread.performResumeActivity(ActivityThread.java:4754) at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:4810) at android.app.servertransaction.ResumeActivityItem.execute(ResumeActivityItem.java:52) at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:190) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:105) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2373) at android.os.Handler.dispatchMessage(Handler.java:107) at android.os.Looper.loop(Looper.java:213) at android.app.ActivityThread.main(ActivityThread.java:8147) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1101) Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void org.apache.cordova.CallbackContext.error(java.lang.String)' on a null object reference at com.neutrinos.plugin.Scan.onActivityResult(Scan.java:107) at org.apache.cordova.CordovaInterfaceImpl.onActivityResult(CordovaInterfaceImpl.java:159) at org.apache.cordova.CordovaActivity.onActivityResult(CordovaActivity.java:359) at android.app.Activity.dispatchActivityResult(Activity.java:8393) at android.app.ActivityThread.deliverResults(ActivityThread.java:5442) at android.app.ActivityThread.performResumeActivity(ActivityThread.java:4754) at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:4810) at android.app.servertransaction.ResumeActivityItem.execute(ResumeActivityItem.java:52) at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:190) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:105) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2373) at android.os.Handler.dispatchMessage(Handler.java:107) at android.os.Looper.loop(Looper.java:213) at android.app.ActivityThread.main(ActivityThread.java:8147) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1101) 2020-02-13 22:37:37.773 5876-5876/com.app.documentscanner I/Process: Sending signal. PID: 5876 SIG: 9