When we call navigator.mediaDevices.getUserMedia({audio: true, video: {facingMode: ‘user’} to get a stream from the camera our app crashes and the promise doesn’t resolve (not going into then nor catch block). This is only happening on Android, and is working fine on Web and also when we open the web app in a chrome browser on the Android phone.
Here is a screenshot of the crash report in Android Studio but the error is pretty misleading. I tried googling the error and also everything I could think about but without any luck.
I also tried to build this poc from jceasarmobile to test if there is a problem with getUserMedia on a WebView but that worked without a problem.
I also would like to mention that we have a working prod version in play store that was build 2 months ago and the code for viewing camera and recording wasn’t changed at all.
I’m using Android Studio Bumblebee Patch 3, Capacitor Android 3.3.4 and tested on multiple devices. I tried to run and check the logs (which were the same) on Xiaomi Pocophone F1 running Android 10, and Google Pixel 6 running Android 12.
I can provide more info if needed, currently I’m working on creating a sample app with only getUserMedia to see if I can reproduce the issue there.
Thank you for the help in advance!