Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Selecting images from Download folder is crashing the app. #285

Open
albytom opened this issue Feb 15, 2022 · 2 comments
Open

Selecting images from Download folder is crashing the app. #285

albytom opened this issue Feb 15, 2022 · 2 comments

Comments

@albytom
Copy link

albytom commented Feb 15, 2022

Summary

The app crashes with the following log when image is picked from Downloads folder.
2022-02-15 21:40:41.828 5322-5601/com.demo.pcu E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #1
Process: com.demo.pcu, PID: 5322
java.lang.RuntimeException: An error occurred while executing doInBackground()
at android.os.AsyncTask$4.done(AsyncTask.java:399)
at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:383)
at java.util.concurrent.FutureTask.setException(FutureTask.java:252)
at java.util.concurrent.FutureTask.run(FutureTask.java:271)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:289)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:919)
Caused by: java.lang.NumberFormatException: For input string: "raw:/storage/emulated/0/Download/2909118.jpg"
at java.lang.Long.parseLong(Long.java:594)
at java.lang.Long.valueOf(Long.java:808)
at com.yalantis.ucrop.util.FileUtils.getPath(FileUtils.java:290)
at com.yalantis.ucrop.task.BitmapLoadTask.processInputUri(BitmapLoadTask.java:171)
at com.yalantis.ucrop.task.BitmapLoadTask.doInBackground(BitmapLoadTask.java:90)
at com.yalantis.ucrop.task.BitmapLoadTask.doInBackground(BitmapLoadTask.java:41)
at android.os.AsyncTask$3.call(AsyncTask.java:378)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:289) 
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) 
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) 
at java.lang.Thread.run(Thread.java:919) 

Code to reproduce

Android version

Android 10, 11, 12

Impacted devices

Installation method

SDK version

Other information

@ashwin-nath-m
Copy link

happening for me too

@YahorHr
Copy link

YahorHr commented Jun 26, 2023

oInBackground: ImageDecoder.createSource: java.io.FileNotFoundException: /storage/emulated/0/Download/rick-and-morty-2013.jpg: open failed: EACCES (Permission denied) at libcore.io.IoBridge.open(IoBridge.java:496) at java.io.FileInputStream.<init>(FileInputStream.java:159) at java.io.FileInputStream.<init>(FileInputStream.java:115) at android.content.ContentResolver.openInputStream(ContentResolver.java:1185) at com.yalantis.ucrop.task.BitmapLoadTask.doInBackground(BitmapLoadTask.java:102) at com.yalantis.ucrop.task.BitmapLoadTask.doInBackground(BitmapLoadTask.java:36) at android.os.AsyncTask$3.call(AsyncTask.java:378) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) at java.lang.Thread.run(Thread.java:919) Caused by: android.system.ErrnoException: open failed: EACCES (Permission denied) at libcore.io.Linux.open(Native Method) at libcore.io.ForwardingOs.open(ForwardingOs.java:167) at libcore.io.BlockGuardOs.open(BlockGuardOs.java:252) at libcore.io.ForwardingOs.open(ForwardingOs.java:167) at android.app.ActivityThread$AndroidOs.open(ActivityThread.java:7255) at libcore.io.IoBridge.open(IoBridge.java:482) at java.io.FileInputStream.<init>(FileInputStream.java:159)  at java.io.FileInputStream.<init>(FileInputStream.java:115)  at android.content.ContentResolver.openInputStream(ContentResolver.java:1185)  at com.yalantis.ucrop.task.BitmapLoadTask.doInBackground(BitmapLoadTask.java:102)  at com.yalantis.ucrop.task.BitmapLoadTask.doInBackground(BitmapLoadTask.java:36)  at android.os.AsyncTask$3.call(AsyncTask.java:378)  at java.util.concurrent.FutureTask.run(FutureTask.java:266)  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)  at java.lang.Thread.run(Thread.java:919)  2023-06-26 16:53:18.125 31735-31735 TransformImageView E onFailure: setImageUri java.lang.IllegalArgumentException: Bitmap could not be decoded from the Uri: [file:///storage/emulated/0/Download/rick-and-morty-2013.jpg] at com.yalantis.ucrop.task.BitmapLoadTask.doInBackground(BitmapLoadTask.java:118) at com.yalantis.ucrop.task.BitmapLoadTask.doInBackground(BitmapLoadTask.java:36) at android.os.AsyncTask$3.call(AsyncTask.java:378) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) at java.lang.Thread.run(Thread.java:919) Caused by: java.io.FileNotFoundException: /storage/emulated/0/Download/rick-and-morty-2013.jpg: open failed: EACCES (Permission denied) at libcore.io.IoBridge.open(IoBridge.java:496) at java.io.FileInputStream.<init>(FileInputStream.java:159) at java.io.FileInputStream.<init>(FileInputStream.java:115) at android.content.ContentResolver.openInputStream(ContentResolver.java:1185) at com.yalantis.ucrop.task.BitmapLoadTask.doInBackground(BitmapLoadTask.java:102) at com.yalantis.ucrop.task.BitmapLoadTask.doInBackground(BitmapLoadTask.java:36)  at android.os.AsyncTask$3.call(AsyncTask.java:378)  at java.util.concurrent.FutureTask.run(FutureTask.java:266)  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)  at java.lang.Thread.run(Thread.java:919)  Caused by: android.system.ErrnoException: open failed: EACCES (Permission denied) at libcore.io.Linux.open(Native Method) at libcore.io.ForwardingOs.open(ForwardingOs.java:167) at libcore.io.BlockGuardOs.open(BlockGuardOs.java:252) at libcore.io.ForwardingOs.open(ForwardingOs.java:167) at android.app.ActivityThread$AndroidOs.open(ActivityThread.java:7255) at libcore.io.IoBridge.open(IoBridge.java:482) at java.io.FileInputStream.<init>(FileInputStream.java:159)  at java.io.FileInputStream.<init>(FileInputStream.java:115)  at android.content.ContentResolver.openInputStream(ContentResolver.java:1185)  at com.yalantis.ucrop.task.BitmapLoadTask.doInBackground(BitmapLoadTask.java:102)  at com.yalantis.ucrop.task.BitmapLoadTask.doInBackground(BitmapLoadTask.java:36)  at android.os.AsyncTask$3.call(AsyncTask.java:378)  at java.util.concurrent.FutureTask.run(FutureTask.java:266)  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)  at java.lang.Thread.run(Thread.java:919) 
I had similar crash. This fix help me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants