Skip to content
This repository was archived by the owner on May 15, 2024. It is now read-only.
This repository was archived by the owner on May 15, 2024. It is now read-only.

[Bug] Still unable to use MediaPicker ImageCapture on Android without declaring WRITE_EXTERNAL_STORAGE permissions in manifest #2037

@plebnz

Description

@plebnz

Description

Found in Xamarin Essentials 1.7.3 on Android 11 targeting SDK v31

MediaPicker Image Capture still requires WRITE_EXTERNAL_STORAGE in the manifest otherwise i get a "You need to declare using the permission: android.permission.WRITE_EXTERNAL_STORAGE in your AndroidManifest.xml"

All I want is to capture an image and post it to a server without writing to external storage - Why cant we have the option to write/cache to directories that do not require this permission?

Update: For now I have forked this project and deleted line 59 from the MediaPicker.android file in the project.
await Permissions.EnsureGrantedAsync<Permissions.StorageWrite>(); <-- Deleted

I have compiled the forked project and added it to my application and I can now take pictures and post to server using app cache and no reqauirement to add WRITE_EXTERNAL_STORAGE to manifest.

I feel that i missing something here, some questions I have

  • What happens if I attempt to run this application on an older android OS.
  • Am i supposed to be using maxSDk on the in the manifest on the use-permission for external storage

I dont think the docs are very clear around how this should be handling it and I'm pretty sure I have misunderstood something and I'm just not using the official package correctly in my application correctly so happy to be corrected and delete this bug report as required.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions