androidxamarinxamarin.androidandroid-13xamarin-essentials

Xamarin.Android MediaPicker.CapturePhotoAsync does not work in Android 13


I am using the Xamarin.Essentials MediaPicker for capturing images in my app. https://learn.microsoft.com/de-de/xamarin/essentials/media-picker?tabs=android

just like var photo = await MediaPicker.CapturePhotoAsync();

For Android < 13 I am asking for permissions:

<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.CAMERA" />

and everything works fine.

Since those permission do not work for Android 13, I am asking for

<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />

(see Android 13 - How to request WRITE_EXTERNAL_STORAGE)

the problem is, that the Xamarin.Essentials.MediaPicker still misses the StorageWritePermission when trying to take a photo. But I can't ask for those in Android 13.

enter image description here

Any ideas how to make it work for Android 13?

Info:

Update:


Solution

  • Fixed in Xamarin.Essentials Nuget Update 1.7.5

    No problem on my Android 13 devices after updating the NugetPackage

    enter image description here