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

FileNotFoundException while choosing image from Gallery #570

Closed
mansoorahmadsamar opened this issue Sep 20, 2019 · 3 comments
Closed

FileNotFoundException while choosing image from Gallery #570

mansoorahmadsamar opened this issue Sep 20, 2019 · 3 comments

Comments

@mansoorahmadsamar
Copy link

Using latest version 2.2.4

Getting imageUri via FileProvider


Uri destinationUri = Uri.fromFile(new File(getCacheDir(), queryName(getContentResolver(), sourceUri)));
        UCrop.Options options = new UCrop.Options();
        options.setCompressionQuality(IMAGE_COMPRESSION);
        options.setToolbarColor(ContextCompat.getColor(this, R.color.colorPrimary));
        options.setStatusBarColor(ContextCompat.getColor(this, R.color.colorPrimary));
        o
```ptions.setActiveWidgetColor(ContextCompat.getColor(this, R.color.colorPrimary));

        if (lockAspectRatio)
            options.withAspectRatio(ASPECT_RATIO_X, ASPECT_RATIO_Y);

        if (setBitmapMaxWidthHeight)
            options.withMaxResultSize(bitmapMaxWidth, bitmapMaxHeight);

        UCrop.of(sourceUri, destinationUri)
                .withOptions(options)
                .start(this);
-------------------------------

-- Exception Log

> E/TransformImageView: onFailure: setImageUri
>     java.io.FileNotFoundException: open failed: EACCES (Permission denied)
>         at android.os.ParcelFileDescriptor.openInternal(ParcelFileDescriptor.java:315)
>         at android.os.ParcelFileDescriptor.open(ParcelFileDescriptor.java:220)
>         at android.content.ContentResolver.openAssetFileDescriptor(ContentResolver.java:1498)
>         at android.content.ContentResolver.openFileDescriptor(ContentResolver.java:1338)
>         at android.content.ContentResolver.openFileDescriptor(ContentResolver.java:1286)
>         at com.yalantis.ucrop.task.BitmapLoadTask.doInBackground(BitmapLoadTask.java:100)
>         at com.yalantis.ucrop.task.BitmapLoadTask.doInBackground(BitmapLoadTask.java:44)
>         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)
@ryanhoo95
Copy link

Im facing this problem as well..

compileSdkVersion and targetSdkVersion = 29
working fine on Android 9 device, but not working on Android 10 device

@clownba0t
Copy link

Fairly certain this is a duplicate of #543.

@Marina24
Copy link

Marina24 commented Jan 24, 2020

Duplicate to #598, #543

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

No branches or pull requests

4 participants