TypeError: null is not an object (evaluating 'WebRTCModule.peerConnectionInit')

Hello,

i cannot get react-native-WebRTC to run on a real android phone.

I ejected expo and then built the app.

This is my function
componentDidMount = async () => {
const configuration = {“iceServers”: [{“url”: “stun:stun.l.google.com:19302”}]};
const pc = new RTCPeerConnection(configuration);
};

And my error is

[Thu May 13 2021 22:20:55.713] WARN Possible Unhandled Promise Rejection (id: 0):
TypeError: null is not an object (evaluating ‘WebRTCModule.peerConnectionInit’)
RTCPeerConnection@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:115895:19
_callee$…

Does anyone have an idea what is happening right now?

In case anyone else runs into this problem, it was was fixed by adding all of the permissions to the manifest. https://github.com/react-native-webrtc/react-native-webrtc/blob/master/Documentation/AndroidInstallation.md

Additionally i went into the android folder and ran .\gradlew clean

After that the error was gone

1 Like

Still get same error. even after adding all permissions, I am using expo