ivpusic / react-native-image-crop-picker

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

Can't open the picker and don't know eactly what permission should be asked #1916

Open Sahand-Stefan opened 1 year ago

Sahand-Stefan commented 1 year ago

Version

Tell us which versions you are using:

Platform

[Error: Required permission missing] permissions .request(permissions.PERMISSIONS.ANDROID.READ_EXTERNAL_STORAGE) .then(async (result) => { await ImagePicker?.openPicker({ cropping: true, mediaType: "photo", cropperCircleOverlay: true, }) .then((photo) => { console.log(photo) pickedFile(photo?.path) }) .catch((error) => console.log(error))

This is the code, no permissions can open the file select.

Expected behaviour

Should open the photos gallery on phone

Actual behaviour

[Error: Required permission missing]

Steps to reproduce

1.

2.

3.

Attachments

// stacktrace or any other useful debug info

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

HostenMarijn commented 1 year ago

Hey make sure to check out the following: https://github.com/ivpusic/react-native-image-crop-picker#important-notes I had to install version 0.38 to make the image picker work again.

edit: Alternatively you can add this <uses-permission android:name="android.permission.READ_MEDIA_IMAGES" /> to your AndroidManifest.xml

Pauligrinder commented 1 year ago

edit: Alternatively you can add this <uses-permission android:name="android.permission.READ_MEDIA_IMAGES" /> to your AndroidManifest.xml

This should be added to the installation guide!

Rukh-commits commented 1 year ago

Hey make sure to check out the following: https://github.com/ivpusic/react-native-image-crop-picker#important-notes I had to install version 0.38 to make the image picker work again.

edit: Alternatively you can add this <uses-permission android:name="android.permission.READ_MEDIA_IMAGES" /> to your AndroidManifest.xml

This was a lifesaver and they should include it in the documentation. Thanks!

sanjay-3129 commented 1 year ago

Hey make sure to check out the following: https://github.com/ivpusic/react-native-image-crop-picker#important-notes I had to install version 0.38 to make the image picker work again.

edit: Alternatively you can add this <uses-permission android:name="android.permission.READ_MEDIA_IMAGES" /> to your AndroidManifest.xml

This perfectly works, please add this to the docs. Thanks

dumitru-buda commented 1 year ago

Hey make sure to check out the following: https://github.com/ivpusic/react-native-image-crop-picker#important-notes I had to install version 0.38 to make the image picker work again.

edit: Alternatively you can add this <uses-permission android:name="android.permission.READ_MEDIA_IMAGES" /> to your AndroidManifest.xml

Hey make sure to check out the following: https://github.com/ivpusic/react-native-image-crop-picker#important-notes I had to install version 0.38 to make the image picker work again.

edit: Alternatively you can add this <uses-permission android:name="android.permission.READ_MEDIA_IMAGES" /> to your AndroidManifest.xml

Did you downgrade it? I have the sdk version set to 33 and crop picker version is 0.40 but still needed to add the permission to work.

tribeless commented 1 year ago

Had to upgrade to 0.38.1 for this to work, had all the permissions in the manifest file. Target sdk 33

<uses-permission android:name="android.permission.READ_MEDIA_AUDIO" />
<uses-permission android:name="android.permission.READ_MEDIA_VIDEO" />
galbenyosef commented 4 months ago

I was having same issue using 0.26.1 with rn 0.73.4, had to add

  1. add manifest permission:
  2. upgrade to 0.41.2 (latest to the time)
Shivangi2909 commented 1 week ago

With above permission, the feature works as expected on Android 13 and above but while submitting to playstore, they are considering it as app violation saying:

Photo and Video Permissions policy: Permission use is not directly related to your app’s core purpose.

Can anyone help with this please.