[🐛] Permission Denial: reading com.google.android.apps.photos.contentprovider.impl.MediaContentProvider uri
See original GitHub issueDescription
[ 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]
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (3 by maintainers)
Top Results From Across the Web
Permission denied : opening provider com.google.android ...
I try to access a photo URI stored previously in SharedPreferences. . · You have a complicate pick intent. · The SharedPreference part...
Read more >reading com.google.android.apps.photos.contentprovider.impl ...
Description. [ Android ] it failed to read content after fetching uri from google photo. Unhandled promise rejection [Error: Permission ...
Read more >How to get read uri permission while retrying uri from shared ...
SecurityException: Permission Denial: opening provider com.google.android.apps.photos.contentprovider.impl.MediaContentProvider from ...
Read more >src/com/android/providers/media/MediaProvider.java
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and....
Read more >Permission Denial: opening provider com.google.android ...
SecurityException: Permission Denial: opening provider com.google.android.apps.photos.contentprovider.impl.MediaContentProvider from ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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.
It seems to be an issue when reading from photos saved in Google Photos. I’ve worked around this problem with a solution that looks like this:
The function above will receive the path given by the picker and then return a proper path you can read from without any permission error