HoLi
HoLi

Reputation: 51

Undefined is not an object(evaluating 'WebRTCModule.mediaStreamTrackGetSources')

I am developing with react-native webrtc app. When get local stream, have a bug as below:

Undefined is not an object(evaluating 'WebRTCModule.mediaStreamTrackGetSources')

This MediaStreamTrack object is an object of react-native-webrtc lib. Can someone suggest me? Thanks in advance!

Image: https://i.sstatic.net/gSeQR.png

Upvotes: 4

Views: 2717

Answers (2)

gtzilla
gtzilla

Reputation: 1315

I got a similar error on iOS. I found I had failed to link libRCTWebRTC.a. Covered in more detail in step #4 here: https://github.com/react-native-webrtc/react-native-webrtc/blob/master/Documentation/iOSInstallation.md#step-4-linkinclude-necessary-libraries

For Android, the process is covered here: https://github.com/react-native-webrtc/react-native-webrtc/blob/master/Documentation/AndroidInstallation.md

Upvotes: 3

HoLi
HoLi

Reputation: 51

I found the answer by adding WebRTCModule from react-native-webrtc lib to all settings and .java file as settings.gradle, build.gradle, manifest file and MainApplication.java.

Upvotes: 0

Related Questions