fix: explicitly grant read URI permission for camera capture intents#17
Merged
Merged
Conversation
Android 18 removes automatic URI permission grants for ACTION_IMAGE_CAPTURE intents. openDeviceCamera and createCameraIntent already granted write permission for the FileProvider output URI but not read, which the camera app also needs. RMET-5241
RMET-5241
OS-pedrogustavobilro
approved these changes
Jul 8, 2026
OS-pedrogustavobilro
left a comment
Contributor
There was a problem hiding this comment.
Tested here, looks good, no longer get warning related to implicit intents in logcat with any of the camera methods. Approved!
Leaving a comment which is unrelated to your PR, but if you'd like to fix it here, I think it's fair to do.
Also: While testing I found an unrelated minor issue that I think we can merge and release together with this one: #18 if you'd like to do a quick 👀
Co-authored-by: Pedro Bilro <pedro.gustavo.bilro@outsystems.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
openDeviceCameraandcreateCameraIntentlaunchACTION_IMAGE_CAPTUREwith a FileProvidercontent://URI inEXTRA_OUTPUT, but only granted write permission on it (FLAG_GRANT_WRITE_URI_PERMISSION). Added the missingFLAG_GRANT_READ_URI_PERMISSIONalongside it. Also bumped the library version to 1.0.2.Context
Android 18 removes automatic URI permission grants for
ACTION_IMAGE_CAPTUREintents — apps must now explicitly request both read and write access, or the camera app silently fails to write the captured photo back into the URI.More info: https://developer.android.com/about/versions/17/behavior-changes-all#restrict-implicit-uri-grants
RMET-5241
Type of changes
Tests
Manual: exercised
Camera.takePhoto()(which delegates toIONCAMRMediaHelper) via thecapacitor-cameraplugin's example app, built locally against this branch. Confirmed photo capture works on Android 7 (API 25) and Android 17.Screenshots (if appropriate)
N/A
Checklist