I'm developing a Xamarin.Forms App using the MediaRecorder to record audiofiles. I've testet it on the following devices:
There it runs without problems. However, on a Jiayu S3 (Android Version 7.1.2) the following line of code fails:
var mediaRecorder = new MediaRecorder();
There is no error shown, although i've enabled all exception types in visual studio. Also, the device log doesn't show any errors. The MediaRecorder is simply not instanciated. The calling method is returned and the media recorder is null.
The permissions given are:
What am I missing?
I've solved the problem. Seems like another app on the smartphone was somehow locking the microphone. However, there was no error showing up, which is kind of strange. I just restarted the phone and the MediaRecorder worked after I did so.
So if you're MediaRecorder is not working as expected, check if another app is locking the microphone, try to close all other apps on the phone you're testing on or restart the phone.