[🐛] Permission Denial: reading com.google.android.apps.photos.contentprovider.impl.MediaContentProvider uri

Description

[ Android ]
it failed to read content after fetching uri from google photo

Unhandled promise rejection [Error: Permission Denial: reading com.google.android.apps.photos.contentprovider.impl.MediaContentProvider uri content://com.google.android.apps.photos.contentprovider/0/1/content:/media/external/images/media/1259/ORIGINAL/NONE/image/jpeg/1615980699 from pid=20074, uid=10303 requires the provider be exported, or grantUriPermission()]

How to repeat issue and example

  • step to reproduce the issue
  • open google photo and choose file
  • and read file as base64
    const base64Content = await RNFetchBlob.fs.readFile( decodeURIComponent(filePath), "base64" );

Solution

Need to inform how to handle ungranted permission

Additional Information

  • Image Picker version: [ “react-native-image-picker”: “3.0.0-vnext.4”.]
  • React Native version: [ “react-native”: “^0.63.2”.]
  • Platform: [Android]
    buildToolsVersion = “29.0.2”
    minSdkVersion = 24
    compileSdkVersion = 29
    targetSdkVersion = 29
    supportLibVersion = “28.0.0”
  • Development Operating System: [MacOs]
  • Dev tools: [vscode]

1 possible answer(s) on “[🐛] Permission Denial: reading com.google.android.apps.photos.contentprovider.impl.MediaContentProvider uri

  1. Latest version returns fileUri for images.
    I hope the issue is solved, if not reply here or create new issue with details I am happy to fix it.