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

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

Closed
brunoaiolfi opened this issue Sep 21, 2023 · 2 comments

Comments

@brunoaiolfi
Copy link

brunoaiolfi commented Sep 21, 2023

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:

<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.MANAGE_DOCUMENTS" />
<uses-permission android:name="android.permission.ACCESS_MEDIA_LOCATION" />
<uses-permission android:name="android.permission.DOWNLOAD_WITHOUT_NOTIFICATION" />
<uses-permission android:name="android.permission.ACTION_OPEN_DOCUMENT" />
<uses-permission android:name="android.permission.READ_MEDIA_AUDIO" />
<uses-permission android:name="android.permission.READ_MEDIA_VIDEO" />
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />

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 ] });

@brunoaiolfi brunoaiolfi changed the title Cant pick any PDF or DOC Cant pick any PDF or DOC - requires that you obtain access using ACTION_OPEN_DOCUMENT or related. Sep 21, 2023
@aviral1518
Copy link

also same issue i am facing. Please help

@github-actions
Copy link

👋 @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!

@github-actions github-actions bot locked and limited conversation to collaborators Sep 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants