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

[BUG] - FileUriExposedException when trying to lunch only camera intent. #274

Closed
ArmChilingarov opened this issue Nov 23, 2021 · 4 comments · Fixed by #275
Closed

[BUG] - FileUriExposedException when trying to lunch only camera intent. #274

ArmChilingarov opened this issue Nov 23, 2021 · 4 comments · Fixed by #275

Comments

@ArmChilingarov
Copy link
Contributor

  • Lib Version 3.3.6

Describe the bug
App gets crashed when I want to open only camera intent .

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.croppersample/com.canhub.cropper.CropImageActivity}: android.os.FileUriExposedException: file:///storage/emulated/0/Android/data/com.example.croppersample/cache/pickImageResult.jpeg exposed beyond app through ClipData.Item.getUri()

To Reproduce
Steps to reproduce the behavior:
in a crop image sample use this part of code.
private val customCropImage = registerForActivityResult(CropImageContract()) {
...
}

customCropImage.launch(
options {
setImagePickerContractOptions(PickImageContractOptions(false,true))
})

Media
Screen Shot 2021-11-23 at 18 30 17

Smartphone (please complete the following information):

  • Device: Xiaomi2 mi a2

  • OS: API Level 30

  • Device: Android emulator

  • OS: API Level 28, 29

@Canato

@Canato
Copy link
Member

Canato commented Nov 24, 2021

Duplicated of #253

@ArmChilingarov
Copy link
Contributor Author

Hey @Canato .

You marked the issue as a duplicate of #253 , but this is absolutely different issue.
If you need more details, I can provide to you .

@Canato
Copy link
Member

Canato commented Nov 26, 2021

Sorry @ArmChilingarov you are right, I'm reopening, but hopefully the PR I'm working will fix this too

@Canato
Copy link
Member

Canato commented Nov 28, 2021

If possible please test

To test this changes
implementation 'com.github.CanHub:Android-Image-Cropper:271-read-files-without-permission-38df1455d6-1'

All feedbacks at #280

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

Successfully merging a pull request may close this issue.

2 participants