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>(CameraCapturer.java:224)
        at org.webrtc.Camera2Capturer.<init>(Camera2Capturer.java:24)
        at org.webrtc.Camera2Enumerator.createCapturer(Camera2Enumerator.java:89)
        at com.oney.WebRTCModule.VideoCaptureController.createVideoCapturer(VideoCaptureController.java:210)
        at com.oney.WebRTCModule.VideoCaptureController.<init>(VideoCaptureController.java:57)
        at com.oney.WebRTCModule.GetUserMediaImpl.createVideoTrack(GetUserMediaImpl.java:85)
        at com.oney.WebRTCModule.GetUserMediaImpl.getUserMedia(GetUserMediaImpl.java:174)
        at com.oney.WebRTCModule.WebRTCModule.lambda$getUserMedia$2$WebRTCModule(WebRTCModule.java:485)
        at com.oney.WebRTCModule.-$$Lambda$WebRTCModule$C_Gitx4KOYySlWXaI1K4M1yoJoA.run
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
        at java.lang.Thread.run(Thread.java:764)`

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.