fix(android): explicitly grant URI permissions for legacy camera capture#60
Merged
Merged
Conversation
Android 18 removes automatic URI permission grants for ACTION_IMAGE_CAPTURE intents. The deprecated LegacyCameraFlow.openCamera() sent no grant flags at all for its FileProvider output URI, unlike the edit intents elsewhere in this file which already do. RMET-5241
OS-pedrogustavobilro
left a comment
Contributor
There was a problem hiding this comment.
FYI @alexgerardojacinto, lint is failing, probably the line added in the java file. I suppose once the native library is released one can run fmt and then push to see if CI passes.
OS-pedrogustavobilro
approved these changes
Jul 8, 2026
alexgerardojacinto
marked this pull request as ready for review
July 8, 2026 14:18
capacitor-bot
pushed a commit
that referenced
this pull request
Jul 8, 2026
## [8.2.1](v8.2.0...v8.2.1) (2026-07-08) ### Bug Fixes * **android:** explicitly grant URI permissions for legacy camera capture ([#60](#60)) ([df4b6d7](df4b6d7))
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.
Summary
Android 18 removes automatic URI permission grants for
ACTION_IMAGE_CAPTUREintents. The deprecatedLegacyCameraFlow.openCamera()sent no grant flags at all for its FileProvider output URI, unlike the edit intents elsewhere in this file which already do.FLAG_GRANT_READ_URI_PERMISSIONandFLAG_GRANT_WRITE_URI_PERMISSIONto the capture intent.ioncamera-androidto 1.0.2, which contains the equivalent fix for the non-legacy camera flow (ion-android-camera#17).Part of RMET-5241.
Draft:
ioncamera-android:1.0.2is not yet published to Maven Central — this PR is blocked on that release landing. Do not merge until then.Test plan
Camera.getPhoto()(this fix) andCamera.takePhoto()(ion-android-camera fix) via this plugin's example app, built locally against a local Maven artifact forioncamera-android:1.0.2. Confirmed both work on Android 7 (API 25) and Android 17.