Android Question Failed to find configured root ... using CameraIntent ... since B4A-Version 10.70

JOTHA

Well-Known Member
Licensed User
Longtime User
Hello Community,

since I've installed B4A-Version 10.70 there is a new problem when using CameraIntent
(see Android Tutorial [B4X] [B4XPages] Intent based camera)


Error-message:
** Activity (main) Resume **
Error occurred on line: 38 (FileProvider)
java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4j.object.JavaObject.RunMethod(JavaObject.java:132)
at b4a.example.fileprovider._getfileuri(fileprovider.java:124)
at b4a.example.b4xmainpage$ResumableSub_TakePicture.resume(b4xmainpage.java:192)
at b4a.example.b4xmainpage._takepicture(b4xmainpage.java:144)
at b4a.example.b4xmainpage$ResumableSub_Button1_Click.resume(b4xmainpage.java:96)
at b4a.example.b4xmainpage._button1_click(b4xmainpage.java:69)
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.raiseEvent(BA.java:193)
at anywheresoftware.b4a.objects.ViewWrapper$1.onClick(ViewWrapper.java:80)
at android.view.View.performClick(View.java:7191)
at android.view.View.performClickInternal(View.java:7164)
at android.view.View.access$3500(View.java:821)
at android.view.View$PerformClick.run(View.java:27856)
at android.os.Handler.handleCallback(Handler.java:914)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:224)
at android.app.ActivityThread.main(ActivityThread.java:7551)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:995)
Caused by: java.lang.IllegalArgumentException: Failed to find configured root that contains /storage/emulated/0/Android/data/b4a.example/files/shared/tempimage.jpg
at androidx.core.content.FileProvider$SimplePathStrategy.getUriForFile(FileProvider.java:744)
at androidx.core.content.FileProvider.getUriForFile(FileProvider.java:418)
... 26 more

I made the entries in the Manifest ...
I remember that the code worked under B4A-Version 10.6

Maybe there are some new rules in the new version?
 

JOTHA

Well-Known Member
Licensed User
Longtime User
Does it work?
Hello Erel,

your original code works fine!
I guess I made a mistake while transferring it to my own code. Please excuse the interruption.

I still have one more question (or should I open a new thread for it?):
Is it possible that only square photos can be taken?
 
Upvote 0
Top