react-native-image-crop-picker icon indicating copy to clipboard operation
react-native-image-crop-picker copied to clipboard

Not working as expected on Android 13

Open ernst223 opened this issue 1 year ago • 5 comments

Version

Tell us which versions you are using:

  • react-native-image-crop-picker ^0.39.0 (So the latest one)
  • react-native v0.70.3

Platform

Tell us to which platform this issue is related

  • Android

Expected behaviour

It should ask for my permissions and then open the files

Actual behaviour

Nothing

Steps to reproduce

1.Just add the package on a Android 13 emulator or phone

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 MicrosoftTeams-image MicrosoftTeams-image

ernst223 avatar Jun 27 '23 21:06 ernst223

You are likely missing the

<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />

in

android/app/src/main/AndroidManifest.xml #1927

SamJbori avatar Jun 29 '23 09:06 SamJbori

Yes the solution was: in Android 13 and up some permissions is not allowed if you don't do a popup dialog:

if (Platform.OS === 'android') { try { const granted = await PermissionsAndroid.request(PermissionsAndroid.PERMISSIONS.READ_MEDIA_IMAGES, { title: 'Bestandsmachtiging', message: 'Toegang tot bestandsrechten', buttonNeutral: 'Vraag het me later', buttonNegative: 'Cancel', buttonPositive: 'OK', }); if (granted === PermissionsAndroid.RESULTS.GRANTED) { logger.info('You can acces the files'); } else { logger.info('permission denied'); } } catch (err) { logger.warning('Warning in app permissions.', err); } }

ernst223 avatar Jun 29 '23 15:06 ernst223

Add these permissions in android/app/src/main/AndroidManifest.xml image

ayoubshah2720 avatar Jul 26 '23 07:07 ayoubshah2720

if (Platform.OS === 'android') { try { const granted = await PermissionsAndroid.request(PermissionsAndroid.PERMISSIONS.READ_MEDIA_IMAGES, { title: 'Bestandsmachtiging', message: 'Toegang tot bestandsrechten', buttonNeutral: 'Vraag het me later', buttonNegative: 'Cancel', buttonPositive: 'OK', }); if (granted === PermissionsAndroid.RESULTS.GRANTED) { logger.info('You can acces the files'); } else { logger.info('permission denied'); } } catch (err) { logger.warning('Warning in app permissions.', err); } }

Not Working

satyabrata-dash5 avatar Sep 18 '23 07:09 satyabrata-dash5

I am use this permission than work Android 13 but not work lower version like Android 11 Or when use then not work Android 13 but work in Android 11 plz solve my problem

devendra-star avatar Oct 31 '23 08:10 devendra-star