ivpusic / react-native-image-crop-picker

iOS/Android image picker with support for camera, video, configurable compression, multiple images and cropping
MIT License
6.12k stars 1.56k forks source link

E_PICKER_CANCELLED returning on Android 11 #1629

Open sedar-12 opened 3 years ago

sedar-12 commented 3 years ago

I am pretty sure this bug is due to Android 11, as I know they made changes to how storage is accessed. I realize that @ivpusic is working on support for Android 11 as per their latest commit, so if this is planned to be fix soon let me know! If not, maybe someone can look into it. Thank you.

Version

Tell us which versions you are using:

Platform

Tell us to which platform this issue is related

Expected behaviour

Selected photo will proceed to next page

Actual behaviour

After selecting a photo, modal closes and returns "E_PICKER_CANCELLED" error code

Steps to reproduce

  1. Use openPicker function with any parameters

  2. Click on openPicker to open modal

  3. Select photo that you want to use

  4. modal closes and returns "E_PICKER_CANCELLED"

Attachments

Most of these bugs are coming from Xiaomi devices running Android 11 but could be affecting other devices that I am not aware of

Love react-native-image-crop-picker? Please consider supporting our collective: 👉 https://opencollective.com/react-native-image-crop-picker/donate

BasBuur commented 3 years ago

Same issue since the latest Android 11 update on my Poco X3. This phone also runs MIUI which is made by Xiaomi.

ipekmuhammet commented 3 years ago

same. occured on Xiaomi redmi note 9 pro and few samsung phones.

BasBuur commented 3 years ago

@ivpusic Any idea whether this issue should be fixed with your work on Android 11 support? And do you have an indication as to when this update should be ready? I'm getting more and more support requests each day with people that can't upload photos anymore. Please let me know if I can be of any assistance.

ipekmuhammet commented 3 years ago

@BasBuur I'm having same issue with you. What did you do to solve ? I can't reproduce this error 'cause i dont have android 11 phone. are any library that you know not have this problem ?

BasBuur commented 3 years ago

@ipekmuhammet Haven't solved it yet. Will need to find another solution if this library doesn't get an update soon. Unfortunately I'm not a Java dev so I don't have the knowledge to solve it myself. Haven't looked for a different library yet.

harshVikramcrown commented 3 years ago

Have any one got the solution? Because people are not able to upload pic from gallery as well as camera or if it is already fixed please provide a solution for it.Facing problem for android v11.

ankitjaiswal1994 commented 3 years ago

Any update from anyone ?

sedar-12 commented 3 years ago

@BasBuur @ipekmuhammet @harshVikramcrown @ankitjaiswal1994 Found out this issue is fixed by enabling "MiUi Optimization" from the developer options. If anyone knows why this fixes it then maybe we can work on a solution?

kimsean commented 3 years ago

@BasBuur @ipekmuhammet @harshVikramcrown @ankitjaiswal1994 Found out this issue is fixed by enabling "MiUi Optimization" from the developer options. If anyone knows why this fixes it then maybe we can work on a solution?

I tried turning on MiUi Optimzation and it now works

KochMario commented 3 years ago

see #1571 for the ongoing discussion in regards to Android 11 support, unfortunately there's still no updates, besides @ivpusic starting work on it (see 2437d99. But I think he is currently busy and hopes for someone from the community to finish the implementation.

1Jesper1 commented 2 years ago

Any updates yet?

wsyjx22 commented 2 years ago

在红米手机上android 11系统上不能使用如下代码,选择相册直接返回resultCode = 0 final Intent chooserIntent = Intent.createChooser(galleryIntent, "Pick an image"); activity.startActivityForResult(chooserIntent, IMAGE_PICKER_REQUEST);

可以修改为 activity.startActivityForResult(galleryIntent, IMAGE_PICKER_REQUEST);

AkashPatel18 commented 2 years ago

@BasBuur @ipekmuhammet @harshVikramcrown @ankitjaiswal1994 Found out this issue is fixed by enabling "MiUi Optimization" from the developer options. If anyone knows why this fixes it then maybe we can work on a solution?

https://github.com/ivpusic/react-native-image-crop-picker/issues/1629#issuecomment-925728627 i tried MiUi optimization and it works.