我想在Realm中使用Jitsi-Meet(视频通话库)。当我在iOS上运行该应用程序时,Realm无法正常工作。它显示以下错误:
2018-12-28 16:22:34.504 [error][tid:main][RCTModuleData.mm:179] Realm has no setter or ivar for its bridge, which is not permitted. You must either @synthesize the bridge property, or provide your own setter method.
如果我删除Jisti-Meet Library,则Realm可以正常工作。而且Jitsi-Meet也可以在没有领域的情况下正常运行。
react-native init AwesomeProject
npm install realm --save
和react-native link realm
npm install react-native-jitsi-meet --save
node_modules/react-native-jitsi-meet/ios/WebRTC.framework
和node_modules/react-native-jitsi-meet/ios/JitsiMeet.framework
添加到Embed Binaries。 Build Settings
,找到Search Paths
。编辑Framework Search Paths
和Library Search Paths
。并使用$(SRCROOT)/../node_modules/react-native-jitsi-meet/ios
和recursive
现在运行该应用程序,该应用程序将显示错误。
文件名:App.js
import React, {Component} from 'react';
import {Platform, StyleSheet, Text, View, Button} from 'react-native';
import Realm from 'realm';
const instructions = Platform.select({
ios: 'Press Cmd+R to reload,\n' + 'Cmd+D or shake for dev menu',
android:
'Double tap R on your keyboard to reload,\n' +
'Shake or press menu button for dev menu',
});
type Props = {};
export default class App extends Component<Props> {
constructor(props) {
super(props);
this.state = { realm: null };
}
componentWillMount() {
Realm.open({
schema: [{name: 'Dog', properties: {name: 'string'}}]
}).then(realm => {
realm.write(() => {
realm.create('Dog', {name: 'Rex'});
});
this.setState({ realm });
});
}
render() {
const info = this.state.realm
? 'Number of dogs in this Realm: ' + this.state.realm.objects('Dog').length
: 'Loading...';
return (
<View style={styles.container}>
<Text style={styles.welcome}>Welcome to React Native!</Text>
<Text style={styles.instructions}>To get started, edit App.js</Text>
<Text style={styles.instructions}>{instructions}</Text>
<Button title="Video"
// onPress = {() => initiateVideoCall()}
/>
<Text style={styles.welcome}>
{info}
</Text>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF',
},
welcome: {
fontSize: 20,
textAlign: 'center',
margin: 10,
},
instructions: {
textAlign: 'center',
color: '#333333',
marginBottom: 5,
},
});