Samsung only crash - java.lang.RuntimeException: No cameras attached

Hello everyone,

I’m developing a mobile app that simple streams video from the back camera, this app works wonders for every phone model except for some select Samsung devices with Android version 8.0 and 8.1 so far.

Detailed device model list:

  • Galaxy A5(2017) (a5y17lte)
  • Galaxy S7 (herolte)
  • Galaxy S7 edge (hero2lte)
  • Galaxy Tab A (2016) (gtaxllte)
  • Galaxy J7(2016) (j7xelte)
  • Galaxy J5 Prime(2016) (on5xelte)

When getUserMedia is called I’m getting the following error:

    `java.lang.RuntimeException: No cameras attached.
        at org.webrtc.CameraCapturer.<init>(
        at org.webrtc.Camera2Capturer.<init>(
        at org.webrtc.Camera2Enumerator.createCapturer(
        at com.oney.WebRTCModule.VideoCaptureController.createVideoCapturer(
        at com.oney.WebRTCModule.VideoCaptureController.<init>(
        at com.oney.WebRTCModule.GetUserMediaImpl.createVideoTrack(
        at com.oney.WebRTCModule.GetUserMediaImpl.getUserMedia(
        at com.oney.WebRTCModule.WebRTCModule.lambda$getUserMedia$2$WebRTCModule(
        at com.oney.WebRTCModule.-$$Lambda$WebRTCModule$
        at java.util.concurrent.ThreadPoolExecutor.runWorker(
        at java.util.concurrent.ThreadPoolExecutor$

I have no way of debugging this myself as I do not own any Samsung phone, so far only a colleague has been able to help with a J5 Prime running Android 8.0 but since we’re in different countries I cannot get my hands on the device.

The app is running with:

  • “react”: “16.9.0”
  • “react-native”: “0.61.5”
  • “react-native-webrtc”: “1.75.3”

I’ve tried reverting to react-native-webrtc 1.69.1, 1.69.2, 1.75.0, 1.75.2 without any improvements.

Thank you so much in advance for all your help.

Hello again guys, just wanted to say that if there is any more information that I can get just let me know and I’ll try to get it. Spent the whole weekend testing with cloud Samsung S7 devices running Android 8 and didn’t get any crash, this is really frustrating. Also I can see reports now of the same crash of Samsung devices running android 9 such as S8 and Note 8.

Thank you once again.