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

FileUriExposedException: #659

Open
jjimenez0611 opened this issue Mar 11, 2019 · 4 comments · Fixed by annatindall/Android-Image-Cropper#1 · May be fixed by #688
Open

FileUriExposedException: #659

jjimenez0611 opened this issue Mar 11, 2019 · 4 comments · Fixed by annatindall/Android-Image-Cropper#1 · May be fixed by #688

Comments

@jjimenez0611
Copy link

I have this error..
Caused by: android.os.FileUriExposedException: file:///storage/emulated/0/Android/data/com.soin.TSA/cache/pickImageResult.jpeg exposed beyond app through ClipData.Item.getUri()

Looks like this happens on Android N

if (Build.VERSION.SDK_INT >=  Build.VERSION_CODES.N) {
          imageUri = Uri.parse(filepath);
    } else{
           imageUri = Uri.fromFile(new File(filepath));
    }

The method getCaptureImageOutputUri() use Uri.fromFile

@joelgetaction
Copy link

Hi @ArthurHub @mradzinski @unverbraucht @Vantablack @gazialankus any chance we can get a fix for this? This is crashing expo apps and bare apps on any Android device running API 24 or later and we can't use the camera there. See the attached expo issue. Any way I can help? I can test on device or I'd be willing to provide a $ cash bug bounty to fix this if that helps. :-)

I'd offer a PR myself but my Android skills are weak.

@annatindall
Copy link

I'm experiencing this crash using the sample app on Android Q Beta 4

@NickButcher1
Copy link

NickButcher1 commented Jun 24, 2019

@ArthurHub I also hit this crash on the Android Q beta 4. Is it possible for you to merge the PR from @annatindall and issue a 2.9.0 release of imagecropper. I am keen to get my app tested and working on Android Q before the final version of Q is released. Thanks.

@NickButcher1
Copy link

Hi @ArthurHub any news on when you might be able to release an update including this fix, thanks.

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