App Crashes when I am taking pictures on Android devices(Samsung tab and mobile)

Albin Lukose 0 Reputation points

Media Picker Interface For Maui

Followed these steps to capture image in my android device(Samsung tablet and Samsung mobile phone with latest API).The app crashes frequently once you capture the image. Tried debugging but no information is retrieved while crashing. App crashes and restart by itself .Not able to replicate this issue in Emulator. This happens randomly. Sometimes it works sometimes not.

I have already added the necessary permissions for image capturing :

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

Is this something related to Code ?

 if (MediaPicker.Default.IsCaptureSupported)
            FileResult photo = await MediaPicker.Default.CapturePhotoAsync();

            if (photo != null)
                //do nothing

Is there any solution or alternate libraries available for image capturing so that I can capture safely ?

A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
1,870 questions
{count} votes