3019_ Aryan Nayak
3019_ Aryan Nayak

Reputation: 11

error on expo go using react-native-webrtc "Cannot read property 'senderGetCapabilities' of null, js engine: hermes"

When I Import This statements

import {
  RTCPeerConnection,
  RTCIceCandidate,
  RTCSessionDescription,
  RTCView,
  MediaStream,
  MediaStreamTrack,
  mediaDevices,
  registerGlobals
} from 'react-native-webrtc';

This error comes in my expo Go(In android mobile):

ERROR TypeError: Cannot read property 'senderGetCapabilities' of null, js engine: hermes ERROR Invariant Violation: "main" has not been registered. This can hap pen if:

  • Metro (the local dev server) is run from the wrong folder. Check if Met ro is running, stop it and restart it in the current project.
  • A module failed to load due to an error and `AppRegistry.registerCompon ent wasn't called., js engine: hermes
"dependencies": {
    "@config-plugins/react-native-webrtc": "^7.0.0",
    "@expo-google-fonts/dev": "^0.2.3",
    "@expo-google-fonts/heebo": "^0.2.3",
    "@expo-google-fonts/inter": "^0.2.3",
    "@expo-google-fonts/kanit": "^0.2.3",
    "@expo-google-fonts/merriweather-sans": "^0.2.3",
    "@expo-google-fonts/open-sans": "^0.2.3",
    "@expo-google-fonts/patua-one": "^0.2.3",
    "@expo-google-fonts/roboto": "^0.2.3",
    "@expo-google-fonts/roboto-slab": "^0.2.3",
    "@expo-google-fonts/rubik": "^0.2.3",
    "@expo/webpack-config": "^19.0.0",
    "@react-navigation/native": "^6.1.7",
    "@react-navigation/native-stack": "^6.9.13",
    "expo": "~49.0.8",
    "expo-camera": "^13.4.3",
    "expo-dev-client": "~2.4.8",
    "expo-splash-screen": "^0.20.5",
    "expo-status-bar": "~1.6.0",
    "react": "18.2.0",
    "react-dom": "18.2.0",
    "react-native": "0.72.4",
    "react-native-dotenv": "^3.4.9",
    "react-native-vector-icons": "^10.0.0",
    "react-native-web": "~0.19.6",
    "react-native-webrtc": "^111.0.3",
    "socket.io-client": "^4.7.2",
    "validator": "^13.11.0"
  }

Platform Information:

React Native Version: "0.72.4"

WebRTC Module Version: "^111.0.3"

Platform OS + Version: windows: 10

expo Go: 2.29.6

chrome: 116.0.5845.141

But If I don't import react-native-webrtc then it runs smoothly. I need to create functionality which uses webrtcthough, how do I fix this?

Upvotes: 0

Views: 1026

Answers (1)

DarkLord Empeor
DarkLord Empeor

Reputation: 1

react-native-webrtc are native code, if you want to use it on Expo, your must use development build follow this Doc https://docs.expo.dev/develop/development-builds/create-a-build/
and add permisson in app.json file like this

Upvotes: 0

Related Questions