react-native-documents / document-picker

Document Picker for React Native
https://react-native-documents.github.io/
MIT License
1.33k stars 434 forks source link

Cant pick any PDF or DOC - requires that you obtain access using ACTION_OPEN_DOCUMENT or related. #682

Closed brunoaiolfi closed 9 months ago

brunoaiolfi commented 9 months ago

When i use DocumentPicker.pick and select a DOC or PDF it returns me this error:

Error: Permission Denial: reading com.android.providers.media.MediaDocumentsProvider uri content://com.android.providers.media.documents/document/document:41 from pid=5269, uid=10154 requires that you obtain access using ACTION_OPEN_DOCUMENT or related.

my permissions in android manifest:

I also request permissions before to use the DocumentPicker:

const permissions = await PermissionsAndroid.requestMultiple([ PermissionsAndroid.PERMISSIONS.READ_EXTERNAL_STORAGE, PermissionsAndroid.PERMISSIONS.WRITE_EXTERNAL_STORAGE, PermissionsAndroid.PERMISSIONS.ACCESS_MEDIA_LOCATION, PermissionsAndroid.PERMISSIONS.CAMERA, PermissionsAndroid.PERMISSIONS.READ_MEDIA_IMAGES, PermissionsAndroid.PERMISSIONS.READ_MEDIA_AUDIO, PermissionsAndroid.PERMISSIONS.READ_MEDIA_VIDEO ]);

How to reproduce:

Just use this to pick documents:

const results = await DocumentPicker.pick({ type: [ DocumentPicker.types.allFiles ] });

aviral1518 commented 9 months ago

also same issue i am facing. Please help

github-actions[bot] commented 9 months ago

:wave: @brunoaiolfi, sorry you're having an issue. This issue is being closed because it does not provide all information required by the issue template. As the issue template explains, we require that you provide a runnable example that reproduces your issue and your environment information. This means you need to provide a code snippet that we can copy-paste into an empty project and see the error ourselves, or provide a git repository with the issue. The reason is that maintainers do not have time to try reproduce bugs themselves. Please try to minimize the superfluous code and focus only on reproducing the bug. Please create a new issue with this and we'll be happy to review it!