Android Question [SOLVED] OCR Mobilevision crash

saunwin

Active Member
Licensed User
Longtime User
Hello, Here is the log from my app. I trying to get an OCR library to work. I'm trying mobilevision by Donmanfred but I get this error.
Any advice ?
TIA

** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
sending message to waiting queue (activity_permissionresult)
running waiting messages (1)
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
sending message to waiting queue (activity_permissionresult)
running waiting messages (1)
YES, sign me up! I agree I want to receive news, offers and information from you. I am submitting consent to you for these purposes and as described in the privacy policy that can be veiwed at your website. I understand that I can withdraw my consent at any time, by visiting your website.
** Activity (main) Resume **
Start Recognize... Recognizer ready = true
Error occurred on line: 962 (Main)
android.os.FileUriExposedException: file:///storage/emulated/0/picture.jpg exposed beyond app through ClipData.Item.getUri()
at android.os.StrictMode.onFileUriExposed(StrictMode.java:1960)
at android.net.Uri.checkFileUriExposed(Uri.java:2356)
at android.content.ClipData.prepareToLeaveProcess(ClipData.java:942)
at android.content.Intent.prepareToLeaveProcess(Intent.java:9850)
at android.content.Intent.prepareToLeaveProcess(Intent.java:9835)
at android.app.Instrumentation.execStartActivity(Instrumentation.java:1610)
at android.app.Activity.startActivityForResult(Activity.java:4501)
at android.app.Activity.startActivityForResult(Activity.java:4459)
at anywheresoftware.b4a.BA.startActivityForResult(BA.java:542)
at de.donmanfred.TextRecognizerwrapper.takePicture(TextRecognizerwrapper.java:210)
at com.slrgames.datacapture.main._ocr_click(main.java:1954)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:348)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:180)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:176)
at anywheresoftware.b4a.objects.ViewWrapper$1.onClick(ViewWrapper.java:80)
at android.view.View.performClick(View.java:6300)
at android.view.View$PerformClick.run(View.java:24941)
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:6523)
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:857)
 

drgottjr

Expert
Licensed User
Longtime User
the error has nothing to do with ocr. what's going on that you didn't tell us about?
 

Attachments

  • saunwin.png
    saunwin.png
    21.9 KB · Views: 147
Upvote 0

saunwin

Active Member
Licensed User
Longtime User
well this is the line (line 4) chucking up the error
Start Recognize... Recognizer ready = true
Error occurred on line: 962 (Main)
android.os.FileUriExposedException: file:///storage/emulated/0/picture.jpg exposed beyond app through ClipData.Item.getUri()

B4X:
Sub OCR_Click
    Log("Start Recognize... Recognizer ready = "& avocr.isOperational)
    If avocr.isOperational Then
        avocr.takePicture
    End If
End Sub
 
Upvote 0

drgottjr

Expert
Licensed User
Longtime User
sorry, you're barely answering the question. did you look at the image posted? almost every line in it needs to be explained. what is
android.os.FileUriExposedException: file:///storage/emulated/0/picture.jpg exposed beyond app through ClipData.Item.getUri()
?
i do not believe donmanfred would use dir.external. and all that text? was it derived via ocr? (that alone would indicate ocr is working fine.) it appears your app has overstepped it bounds. what is it you do in the app to cause that? what is the fascination with dir.external? it's not supposed to be used.
 
Upvote 0

saunwin

Active Member
Licensed User
Longtime User
If I knew what
android.os.FileUriExposedException: file:///storage/emulated/0/picture.jpg exposed beyond app through ClipData.Item.getUri()
was - I wouldn't be asking the question.

All I know is
avocr.takePicture
crashes with the above log
 
Upvote 0

drgottjr

Expert
Licensed User
Longtime User
If I knew what
android.os.FileUriExposedException: file:///storage/emulated/0/picture.jpg exposed beyond app through ClipData.Item.getUri()
was - I wouldn't be asking the question.
so you have no idea what the app is supposed to do after the picture is taken? hard to believe
 
Upvote 0
Top