skrafft / react-native-jitsi-meet

React native wrapper for Jitsi Meet SDK
Apache License 2.0
285 stars 348 forks source link

JitsiMeet.call(url, userInfo); crush Android App #251

Open shay-te opened 3 years ago

shay-te commented 3 years ago

Hello all trying to call but the entire application crash.

    13:54:47.507    unknown:ReactNative     CatalystInstanceImpl caught native exception
com.facebook.react.common.JavascriptException: TypeError: null is not an object (evaluating 'E.SECURITY_LEVEL_ANY'), stack:
<unknown>@441:1268
v@2:1473
<unknown>@423:157
v@2:1473
<unknown>@408:130
v@2:1473
<unknown>@407:126
v@2:1473
<unknown>@406:174
v@2:1473
<unknown>@6:57
v@2:1473
d@2:875
global code@1017:3

    at com.facebook.react.modules.core.ExceptionsManagerModule.reportException(ExceptionsManagerModule.java:83)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:372)
    at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:151)
    at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
    at android.os.Handler.handleCallback(Handler.java:938)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:27)
    at android.os.Looper.loop(Looper.java:223)
    at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:226)
    at java.lang.Thread.run(Thread.java:923)

    13:54:47.507    unknown:DisabledDevSupportManager       Caught exception
com.facebook.react.common.JavascriptException: TypeError: null is not an object (evaluating 'E.SECURITY_LEVEL_ANY'), stack:
<unknown>@441:1268
v@2:1473
<unknown>@423:157
v@2:1473
<unknown>@408:130
v@2:1473
<unknown>@407:126
v@2:1473
<unknown>@406:174
v@2:1473
<unknown>@6:57
v@2:1473
d@2:875
global code@1017:3

    at com.facebook.react.modules.core.ExceptionsManagerModule.reportException(ExceptionsManagerModule.java:83)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:372)
    at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:151)
    at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
    at android.os.Handler.handleCallback(Handler.java:938)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:27)
    at android.os.Looper.loop(Looper.java:223)
    at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:226)
    at java.lang.Thread.run(Thread.java:923)

    13:54:47.507    AndroidRuntime      FATAL EXCEPTION: mqt_native_modules
Process: com.objectivelove, PID: 24141
com.facebook.react.common.JavascriptException: TypeError: null is not an object (evaluating 'E.SECURITY_LEVEL_ANY'), stack:
<unknown>@441:1268
v@2:1473
<unknown>@423:157
v@2:1473
<unknown>@408:130
v@2:1473
<unknown>@407:126
v@2:1473
<unknown>@406:174
v@2:1473
<unknown>@6:57
v@2:1473
d@2:875
global code@1017:3

    at com.facebook.react.modules.core.ExceptionsManagerModule.reportException(ExceptionsManagerModule.java:83)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:372)
    at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:151)
    at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
    at android.os.Handler.handleCallback(Handler.java:938)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:27)
    at android.os.Looper.loop(Looper.java:223)
    at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:226)
    at java.lang.Thread.run(Thread.java:923)

    13:54:47.509    JitsiMeetSDK        JitsiMeetUncaughtExceptionHandler FATAL ERROR
com.facebook.react.common.JavascriptException: TypeError: null is not an object (evaluating 'E.SECURITY_LEVEL_ANY'), stack:
<unknown>@441:1268
v@2:1473
<unknown>@423:157
v@2:1473
<unknown>@408:130
v@2:1473
<unknown>@407:126
v@2:1473
<unknown>@406:174
v@2:1473
<unknown>@6:57
v@2:1473
d@2:875
global code@1017:3

    at com.facebook.react.modules.core.ExceptionsManagerModule.reportException(ExceptionsManagerModule.java:83)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:372)
    at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:151)
    at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
    at android.os.Handler.handleCallback(Handler.java:938)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:27)
    at android.os.Looper.loop(Looper.java:223)
    at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:226)
    at java.lang.Thread.run(Thread.java:923)

com.facebook.react.common.JavascriptException: TypeError: null is not an object (evaluating 'E.SECURITY_LEVEL_ANY'), stack:
<unknown>@441:1268
v@2:1473
<unknown>@423:157
v@2:1473
<unknown>@408:130
v@2:1473
<unknown>@407:126
v@2:1473
<unknown>@406:174
v@2:1473
<unknown>@6:57
v@2:1473
d@2:875
global code@1017:3

    at com.facebook.react.modules.core.ExceptionsManagerModule.reportException(ExceptionsManagerModule.java:83)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:372)
    at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:151)
    at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
    at android.os.Handler.handleCallback(Handler.java:938)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:27)
    at android.os.Looper.loop(Looper.java:223)
    at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:226)
    at java.lang.Thread.run(Thread.java:923)

    13:54:48.008    MDD     DownloadProgressMonitor: Can't find file group for uri: android://com.google.android.googlequicksearchbox/files/sharedminusonemodule/shared/SharedMinusOneData.pb.tmp
devteamtalkag1 commented 3 years ago

I have the same issue with the code from the example App !

React Native : ^0.63.3
"react-native-jitsi-meet": "^2.1.1",


  constructor(props) {
    super(props);
  }

  componentDidMount() {
    console.log('Jitsi Call');

      setTimeout(() => {
        const url = 'https://meet.jit.si/ceciestunereunion'; // can also be only room name and will connect to jitsi meet servers
        const userInfo = { displayName: 'User', email: 'user@example.com', avatar: 'https:/gravatar.com/avatar/abc123' };
        JitsiMeet.call(url, userInfo);
        /* You can also use JitsiMeet.audioCall(url) for audio only call */
        /* You can programmatically end the call with JitsiMeet.endCall() */
      }, 1000);
  }

  componentWillUnmount() {
    JitsiMeet.endCall();
  }

  onConferenceTerminated = (nativeEvent) => {
    /* Conference terminated event */
    console.log('Conference terminated event')
  }

  onConferenceJoined = (nativeEvent)=> {
    /* Conference joined event */
    console.log('Conference joined event')
  }

  onConferenceWillJoin = (nativeEvent) => {
    /* Conference will join event */
    console.log('Conference will join event')
  }
  render() {
    return (
      <View style={{
        flex: 1,
        backgroundColor: 'black'
        }}>
        <JitsiMeetView style={{ flex: 1, height: '100%', width: '100%' }} />
      </View>
    );
  }

}```
alexandrtovmach commented 3 years ago

Figured out the problem and right now it works for me in development and build release apk. Full diff of my changes you can find here.

  1. Follow installation guide from this repo README
  2. Downgrade @react-native-community/netinfoto 4.7.0
  3. Add next attributes (if not exist) to application tag in android/app/src/debug/AndroidManifest.xml
    android:allowBackup="true" tools:replace="android:allowBackup"
  4. Add following attributes (if not exist) to application tag in android/app/src/main/AndroidManifest.xml
    tools:replace="android:allowBackup"
  5. Add following attributes (if not exist) to manifest tag in android/app/src/main/AndroidManifest.xml
    xmlns:tools="http://schemas.android.com/tools"
  6. Add "packagingOptions" to android/app/build.gradle
    packagingOptions {
    exclude 'META-INF/react-native-webview_release.kotlin_module'
    }
  7. Make sure that you did the last step from installation guide, and then, add "debugImplementation" in a similar way:
    debugImplementation(project(':react-native-jitsi-meet')) {
    exclude group: 'com.facebook',module:'hermes'
    }

Possible fix for:

nanhlua96 commented 3 years ago

@alexandrtovmach after trying to do it, something still work abnormal.

alexandrtovmach commented 3 years ago

@nanhlua96 I believe things that you have is not related to "Android crash issue", so can't suggest anything here

but maybe I know what you have :wink:, just check: https://github.com/skrafft/react-native-jitsi-meet/issues/265

nanhlua96 commented 3 years ago

@alexandrtovmach thanks, I also try another way and it not require downgrade netinfo package that change minSdkVersion and tools.build:gradle in android/build.gradle Screen Shot 2021-05-06 at 11 11 59 and in android/app/build.gradle just need

implementation ('org.jitsi.react:jitsi-meet-sdk:3.1.+') {
        exclude group: 'com.facebook.react', module:'react-native-vector-icons'
        exclude group: 'com.facebook.react', module:'react-native-webview'
        exclude group: 'com.facebook.react', module:'react-native-youtube'
        exclude group: 'com.facebook.react', module:'react-native-community-async-storage'
        // exclude group: 'com.facebook.react', module:'react-native-linear-gradient'
        exclude group: 'com.facebook.react', module:'react-native-background-timer'
        exclude group: 'com.facebook', module:'hermes'
        transitive = true
    }
alexandrtovmach commented 3 years ago

@nanhlua96 is that works for runtime and release?

nanhlua96 commented 3 years ago

@alexandrtovmach I just test on simulator and I am still working with those unresponsible buttons, but I am sure you can test it on real devices.

nanhlua96 commented 3 years ago

I face with some change in metro config that the old blacklist has removed so I replace with exclusion list but i don't really know it correct or not

const blacklist = require('metro-config/src/defaults/exclusionList');
...
resolver: {
      blacklistRE: blacklist([
        /ios\/Pods\/JitsiMeetSDK\/Frameworks\/JitsiMeet.framework\/assets\/node_modules\/react-native\/.*/,
      ]),
...

I don't know Has blacklistRE in resolver changed also

alexandrtovmach commented 3 years ago

To be sure that solution form https://github.com/skrafft/react-native-jitsi-meet/issues/251#issuecomment-833210944 works, you need to run app in real-time (emulator), and also compile an APK and run it too. Because I found it a bit annoying when I though that I fixed the issue, and then everything fails on release build