Reputation: 2188
I am facing an issue in my live react native app with JitsiMeet integration. I am using this library for jitsi-meet integration in my app. Now whenever I click on button to start video call via jitsi-meet,my app always crash with below logcats:
E/ReactNativeJS: TypeError: null is not an object (evaluating 'n.default.configureProps')
2019-11-30 11:54:10.587 28571-29151/com.telehealthcare E/ReactNativeJS: Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication)
2019-11-30 11:54:10.598 28571-29152/com.telehealthcare E/AndroidRuntime: FATAL EXCEPTION: mqt_native_modules
Process: com.telehealthcare, PID: 28571
com.facebook.react.common.JavascriptException: TypeError: null is not an object (evaluating 'n.default.configureProps'), stack:
s@555:2197
<unknown>@555:2245
v@2:1474
<unknown>@500:734
v@2:1474
<unknown>@499:206
v@2:1474
<unknown>@498:271
v@2:1474
<unknown>@494:268
v@2:1474
<unknown>@493:1546
v@2:1474
<unknown>@383:171
v@2:1474
<unknown>@6:58
v@2:1474
d@2:876
global code@1124:4
at com.facebook.react.modules.core.ExceptionsManagerModule.reportException(ExceptionsManagerModule.java:71)
at java.lang.reflect.Method.invoke(Native Method)
at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:371)
at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:150)
at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
at android.os.Handler.handleCallback(Handler.java:789)
at android.os.Handler.dispatchMessage(Handler.java:98)
at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:26)
at android.os.Looper.loop(Looper.java:164)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:225)
at java.lang.Thread.run(Thread.java:764)
2019-11-30 11:54:10.601 28571-29152/com.telehealthcare E/JitsiMeetSDK: JitsiMeetUncaughtExceptionHandler FATAL ERROR
Here is my videocall screen:
import React from 'react';
import { View } from 'react-native';
import JitsiMeet, { JitsiMeetView } from 'react-native-jitsi-meet';
class VideoCallScreen extends React.Component {
constructor(props) {
super(props);
this.onConferenceTerminated = this.onConferenceTerminated.bind(this);
this.onConferenceJoined = this.onConferenceJoined.bind(this);
this.onConferenceWillJoin = this.onConferenceWillJoin.bind(this);
}
componentDidMount() {
setTimeout(() => {
// this.setState({data:this.props.navigation.state.params.data});
const url = this.props.navigation.state.params.callUrl;
var isAudio = this.props.navigation.state.params.isAudio;
console.log("VideoCallScreen url: " + url+" & isAudio: " + isAudio);
if(isAudio){
JitsiMeet.audioCall(url);
} else {
JitsiMeet.call(url);
}
/* You can programmatically end the call with JitsiMeet.endCall() */
}, 1000);
}
onConferenceTerminated(nativeEvent) {
/* Conference terminated event */
console.log('onConferenceTerminated');
}
onConferenceJoined(nativeEvent) {
/* Conference joined event */
console.log('onConferenceJoined');
}
onConferenceWillJoin(nativeEvent) {
/* Conference will join event */
console.log('onConferenceWillJoin');
}
render() {
return (
<View style={{ backgroundColor: 'black',flex: 1 }}>
<JitsiMeetView onConferenceTerminated={this.onConferenceTerminated} onConferenceJoined={this.onConferenceJoined} onConferenceWillJoin={this.onConferenceWillJoin} style={{ flex: 1, height: '100%', width: '100%' }} />
</View>
);
}
}
export default VideoCallScreen;
Here is the code of button click:
var url = "https://my.url.app/" + finalName;
var {navigate} = this.props.navigation;
navigate('VideoCallScreen', {callUrl:url, isAudio:this.state.isAudioEnable})
Please help me where I am going wrong. Any help will be appreciated.
EDIT
Now, according to react-native-jitsi-meet manual installation guidelines, I added below code to my app/build.gradle:
project.ext.react = [
entryFile: "index.js",
bundleAssetName: "app.bundle",// This line
]
Added this code to MainApplication.java:
@Override
protected @Nullable String getBundleAssetName() {
return "app.bundle";
}
Now, app is always crashes on start with this logs:
java.lang.RuntimeException: Unable to load script. Make sure you're either running a Metro server (run 'react-native start') or that your bundle 'app.bundle' is packaged correctly for release.
at com.facebook.react.bridge.CatalystInstanceImpl.jniLoadScriptFromAssets(Native Method)
at com.facebook.react.bridge.CatalystInstanceImpl.loadScriptFromAssets(CatalystInstanceImpl.java:227)
at com.facebook.react.bridge.JSBundleLoader$1.loadScript(JSBundleLoader.java:28)
at com.facebook.react.bridge.CatalystInstanceImpl.runJSBundle(CatalystInstanceImpl.java:261)
at com.facebook.react.ReactInstanceManager.createReactContext(ReactInstanceManager.java:1175)
at com.facebook.react.ReactInstanceManager.access$1000(ReactInstanceManager.java:125)
at com.facebook.react.ReactInstanceManager$5.run(ReactInstanceManager.java:951)
at java.lang.Thread.run(Thread.java:764)
Any solution for this error?
Upvotes: 1
Views: 2523
Reputation: 7467
As we have provided bundleAssetName: "app.bundle". I have used the following script on my package.json and the error is resolved.
"debug-build": "react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/app.bundle --assets-dest android/app/src/main/res/ && cd android && ./gradlew assembleDebug && cd .. && rm -rf android/app/src/main/res/drawable-* && rm -rf android/app/src/main/res/raw/* && rm -rf android/app/src/main/assets/*",
Project dependencies:
"react": "16.11.0", "react-native": "0.62.2", "react-native-jitsi-meet": "^2.1.1"
Upvotes: 1