burhanrashid52 / PhotoEditor

A Photo Editor library with simple, easy support for image editing using paints,text,filters,emoji and Sticker like stories.
MIT License
4.17k stars 992 forks source link

Share functionality crashes application #328

Closed ursprakash closed 3 years ago

ursprakash commented 3 years ago

Hi,

While trying to use share functionality it asks to save the image first, After successfully saved the image trying to use share functionality it crashes the application with following error stacktrace.

E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.burhanrashid52.photoediting, PID: 22960
    java.lang.IllegalArgumentException: Failed to find configured root that contains /external/images/media/317089
        at androidx.core.content.FileProvider$SimplePathStrategy.getUriForFile(FileProvider.java:744)
        at androidx.core.content.FileProvider.getUriForFile(FileProvider.java:418)
        at com.burhanrashid52.photoediting.EditImageActivity.buildFileProviderUri(EditImageActivity.java:367)
        at com.burhanrashid52.photoediting.EditImageActivity.shareImage(EditImageActivity.java:361)
        at com.burhanrashid52.photoediting.EditImageActivity.onClick(EditImageActivity.java:335)
        at android.view.View.performClick(View.java:6323)
        at android.view.View$PerformClick.run(View.java:25122)
        at android.os.Handler.handleCallback(Handler.java:869)
        at android.os.Handler.dispatchMessage(Handler.java:101)
        at android.os.Looper.loop(Looper.java:206)
        at android.app.ActivityThread.main(ActivityThread.java:6784)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:852)
burhanrashid52 commented 3 years ago

@tanoDxyz Can you help on this? This might happened due to the #326 changes

tanoDxyz commented 3 years ago

I believe it is the issue of File provider. and it looks File provider is either not defined or there's issue with paths and moreover the following links may help.

https://developer.android.com/reference/androidx/core/content/FileProvider

https://stackoverflow.com/questions/42516126/fileprovider-illegalargumentexception-failed-to-find-configured-root

burhanrashid52 commented 3 years ago

@tanoDxyz Can you raise a PR for this fix?

tanoDxyz commented 3 years ago

Although it does not seems to be photoeditor's issue but i will do PR in a day or two.

burhanrashid52 commented 3 years ago

@tanoDxyz Is there any update on the PR ?

github-actions[bot] commented 3 years ago

This issue is stale because it has been open 20 days with no activity. Remove stale label or comment or this will be closed in 3 days.

github-actions[bot] commented 3 years ago

This issue was closed because it has been stalled for 5 days with no activity.