Hello,
Welcome to our Microsoft Q&A platform!
1.Please make sure the related permissions have been added to the AndroidManifest.xml. The Xamarin.Essentials.MediaPicker api doesn't require the File_Paths.xml. Please check the related doc to get the details: https://learn.microsoft.com/en-us/xamarin/essentials/media-picker?tabs=android
If you want to caputre a photo and set it as the image's source, try using the ImageSource.FromStream
command to do this.
private async void Button_Clicked(object sender, EventArgs e)
{
try
{
var objPhoto = await MediaPicker.CapturePhotoAsync();
if (objPhoto == null)
return;
var objStream = await objPhoto.OpenReadAsync();
img.Source = ImageSource.FromStream(() => objStream);
}
catch (Exception ex)
{
}
}
2.What device and Android sdk do you face the issue? Try to test the code on another emulator or device?
Best Regards,
Jarvan Zhang
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.