Xamarin Forms Android crashes while taking photo without exception. But this happens in like 65% of tries. Sometimes app doesn't crash and I can take photo normally. On other phone(same model) application crashes every time I want to take photo.
I'm using https://github.com/jamesmontemagno/MediaPlugin like this:
if (!CrossMedia.Current.IsCameraAvailable)
{
DisplayAlert("No Camera", ":( No camera avaialble.", "OK");
return;
}
var file = await CrossMedia.Current.TakePhotoAsync(new Plugin.Media.Abstractions.StoreCameraMediaOptions
{
Directory = "Sample",
Name = "testPO.jpg"
});
if (file == null)
return;
DisplayAlert("File Location", file.Path, "OK");
Camera loads without problem, but when I press "Take photo" button application crashes and debugging in Visual Studio stops without any exception.
Thank you for any help.