Android TypeError:null不是对象(计算';OT.setNativeEvents';)
我正在使用opentok react native将视频通话功能添加到我的应用程序中。该代码在虚拟android设备中运行良好,但当我尝试在我的物理设备上运行该应用程序时,我遇到了此错误 TypeError:null不是对象(正在计算'OT.setNativeEvents') 谁能帮帮我吗。 我的代码是Android TypeError:null不是对象(计算';OT.setNativeEvents';),android,reactjs,react-native,opentok,videocall,Android,Reactjs,React Native,Opentok,Videocall,我正在使用opentok react native将视频通话功能添加到我的应用程序中。该代码在虚拟android设备中运行良好,但当我尝试在我的物理设备上运行该应用程序时,我遇到了此错误 TypeError:null不是对象(正在计算'OT.setNativeEvents') 谁能帮帮我吗。 我的代码是 import React, {Component} from 'react'; import {View} from 'react-native'; import {OT, OTPublish
import React, {Component} from 'react';
import {View} from 'react-native';
import {OT, OTPublisher, OTSession, OTSubscriber} from "opentok-react-native";
export default class VideoCall extends Component {
constructor(props) {
super(props);
this.publisherProperties = {
publishAudio: false,
cameraPosition: 'front'
};
this.publisherEventHandlers = {
streamCreated: event => {
console.log('Publisher stream created!', event);
},
streamDestroyed: event => {
console.log('Publisher stream destroyed!', event);
}
};
}
render() {
return (
<OTSession apiKey="my api" sessionId="session id " token="token">
<OTPublisher
properties={this.publisherProperties}
eventHandlers={this.publisherEventHandlers}
style={{ height: 100, width: 100 }}
/>
</OTSession>
);
}
}
import React,{Component}来自'React';
从“react native”导入{View};
从“opentok react native”导入{OT,OTPublisher,OTSession,OTSubscriber};
导出默认类VideoCall扩展组件{
建造师(道具){
超级(道具);
this.publisherProperties={
publishAudio:错,
摄像机位置:“前方”
};
this.publisherventhandles={
streamCreated:event=>{
log('Publisher stream created!',事件);
},
streamdestromed:event=>{
log('Publisher stream destromed!',事件);
}
};
}
render(){
返回(
);
}
}