ArthurHub / ArthurHub/Android-Image-Cropper

Caused by: android.os.FileUriExposedException

Open
#824 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
6.4k
Forks
1.4k
PR merge metrics
No merged PRs in 30d

Description

this crashing my app on so many devices -

java.lang.RuntimeException:
at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:3430)
at android.app.ActivityThread.handleLaunchActivity (ActivityThread.java:3594)
at android.app.servertransaction.LaunchActivityItem.execute (LaunchActivityItem.java:85)
at android.app.servertransaction.TransactionExecutor.executeCallbacks (TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute (TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage (ActivityThread.java:2067)
at android.os.Handler.dispatchMessage (Handler.java:106)
at android.os.Looper.loop (Looper.java:223)
at android.app.ActivityThread.main (ActivityThread.java:7698)
at java.lang.reflect.Method.invoke (Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:592)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:952)
Caused by: android.os.FileUriExposedException:
at android.os.StrictMode.onFileUriExposed (StrictMode.java:2141)
at android.net.Uri.checkFileUriExposed (Uri.java:2391)
at android.content.ClipData.prepareToLeaveProcess (ClipData.java:964)
at android.content.Intent.prepareToLeaveProcess (Intent.java:11234)
at android.content.Intent.prepareToLeaveProcess (Intent.java:11240)
at android.content.Intent.prepareToLeaveProcess (Intent.java:11219)
at android.app.Instrumentation.execStartActivity (Instrumentation.java:1724)
at android.app.Activity.startActivityForResult (Activity.java:5320)
at androidx.fragment.app.FragmentActivity.startActivityForResult (FragmentActivity.java:6)
at android.app.Activity.startActivityForResult (Activity.java:5278)
at androidx.fragment.app.FragmentActivity.startActivityForResult (FragmentActivity.java:6)
at com.theartofdev.edmodo.cropper.CropImage.startPickImageActivity (CropImage.java:5)
at com.theartofdev.edmodo.cropper.CropImageActivity.onCreate (CropImageActivity.java:111)
at android.app.Activity.performCreate (Activity.java:8000)
at android.app.Activity.performCreate (Activity.java:7984)
at android.app.Instrumentation.callActivityOnCreate (Instrumentation.java:1310)
at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:3403)
at android.app.ActivityThread.handleLaunchActivity (ActivityThread.java:3594)
at android.app.servertransaction.LaunchActivityItem.execute (LaunchActivityItem.java:85)
at android.app.servertransaction.TransactionExecutor.executeCallbacks (TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute (TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage (ActivityThread.java:2067)
at android.os.Handler.dispatchMessage (Handler.java:106)
at android.os.Looper.loop (Looper.java:223)
at android.app.ActivityThread.main (ActivityThread.java:7698)
at java.lang.reflect.Method.invoke (Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:592)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:952)

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the stack trace entries for CropImage.startPickImageActivity in CropImage.java and CropImageActivity.onCreate in CropImageActivity.java. Reproduce the launch on an affected Android device or version and trace the file URI passed through the intent. Done means the image-picking flow no longer throws FileUriExposedException on the reported devices.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java
Domain
mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.