Skip to content

[Android] Saving photo falsely reports permissions error on Android #114

@mihailapuste

Description

@mihailapuste

Describe the bug
On Android, calling Media.savePhoto from @capacitor-community/media triggers the runtime permission prompt as expected, but immediately fails after permissions are granted with:

Missing the following permissions in AndroidManifest.xml: android.permission.WRITE_EXTERNAL_STORAGE

This appears to be a false positive: permissions have been granted, but the plugin still reports a missing manifest permission.


To Reproduce

  1. Open the app on an Android device that has not yet granted media/storage permissions.
  2. Perform any action that saves a photo to the device (our “Save photo to device” flow).
  3. When prompted, grant the requested permission(s).
  4. Observe that the operation fails with the manifest error above and the app shows an error toast.

Minimal code path (album creation disabled to isolate the issue):

try {
  await Media.savePhoto({
    path: convertToHttps(url),
    fileName,
  });
} catch (e) {
  // shows toast with the error message
}

Expected behavior
After granting permissions, Media.savePhoto should succeed (or fail for a legitimate reason unrelated to manifest permissions).


Screenshots / Recording
Screen recording showing permission grant followed by the error toast:

GMT20251119-000521_Clip_Mihai.Lapuste.s.Clip.11_18_2025.mp4

Saving after this first error works fine!


Device Info (please complete the following information):

  • Device: API 36 Simulator
  • OS: Android 16 (API 36)
  • Capacitor Version: "7.0.0"
  • Plugin Version: "^8.0.1"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions