How to integrate the lib-jitsi-meet into react-native android app? (This is my own app, not the jitsi-meet android project)


#1

I managed to implement the iOS app react-native by using

  1. jitsi/react-native-webrtc@111da88
  2. 8696178
  3. import JitsiMeetJS from ‘…/…/react/features/base/lib-jitsi-meet/_’;
  4. “react-native”: “^0.57.3”,

But, Android always got the error msg when importing JitsiMeetJS.

java.lang.Boolean cannot be cast to java.lang.Double

Does anyone know the clues how to solve this??

I followed the jitsi-meet android build setting https://github.com/jitsi/jitsi-meet/tree/master/android
(building the necessary package like sdk)

I also commented on the similar issue on Github.


#2

What file isngovong that error? Can you paste some output?


#3

Hi sagul! Thanks for your quick reply!!

For the file, please check this img.
mainly, https://github.com/facebook/react-native/blob/master/ReactAndroid/src/main/java/com/facebook/react/bridge/ReadableNativeArray.java#L154 is the error location in react-native

This red screen happens only when adding
“import “./react/features/base/lib-jitsi-meet/_”;”

I verified this msg in Galaxy S8 edge, huawei p20


#4

What JitsiMeetJS funciona are you calling? Do you see a stacktrace in adb?


#5

I used adb logcat in the case of the error.

This is the logoutput.

Is this correct? I am a little new to android.
From this, I don’t know What JitsiMeetJS functions I am calling. this is the same log in the above red screen.

$ adb logcat | grep " E " system
10-21 22:08:46.676 26902 26902 E propClient: PropClient failed to load
10-21 22:08:49.419 10427 10427 E adbd : recv: OPEN 0000007b 00000000 0047:73 68 65 6C 6C 2C 76 32 2C 54 45 52 4D 3D 78 74 65 72 6D 2D 32 35 36 63 6F 6C 6F 72 3A 65 78 70 6F 72 74 20 41 4E 44 52 4F 49 44 5F 4C 4F 47 5F 54 41 47 53 3D 22 27 27 22 3B 20 65 78 65 63 20 6C 6F 67 63 61 74 00
10-21 22:08:49.419 10427 10427 E adbd : service_to_fd: shell,v2,TERM=xterm-256color:export ANDROID_LOG_TAGS="’’"; exec logcat
10-21 22:08:49.457 26905 26905 E propClient: PropClient failed to load
10-21 22:08:49.473 26905 26905 E propClient: PropClient failed to load
10-21 22:08:52.243 25027 25027 E ViewRootImpl: sendUserActionEvent() returned.
10-21 22:08:52.247 2098 2098 E KeyBoardInfoUtils-Japan: getInstance start
10-21 22:08:52.347 25027 26916 E OpenSLESRecorder: Not implemented
10-21 22:08:52.347 25027 26916 E OpenSLESRecorder: Not implemented
10-21 22:08:54.028 1351 2202 E Watchdog: !@Sync 37 [2018-10-21 22:08:54.027]
10-21 22:08:55.525 25027 26921 E unknown:ReactNative: Exception in native call
10-21 22:08:55.525 25027 26921 E unknown:ReactNative: java.lang.ClassCastException: java.lang.Boolean cannot be cast to java.lang.Double
10-21 22:08:55.525 25027 26921 E unknown:ReactNative: at com.facebook.react.bridge.ReadableNativeArray.getDouble(ReadableNativeArray.java:114)
10-21 22:08:55.525 25027 26921 E unknown:ReactNative: at com.facebook.react.bridge.JavaMethodWrapper$4.extractArgument(JavaMethodWrapper.java:64)
10-21 22:08:55.525 25027 26921 E unknown:ReactNative: at com.facebook.react.bridge.JavaMethodWrapper$4.extractArgument(JavaMethodWrapper.java:60)
10-21 22:08:55.525 25027 26921 E unknown:ReactNative: at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:359)
10-21 22:08:55.525 25027 26921 E unknown:ReactNative: at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:160)
10-21 22:08:55.525 25027 26921 E unknown:ReactNative: at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
10-21 22:08:55.525 25027 26921 E unknown:ReactNative: at android.os.Handler.handleCallback(Handler.java:789)
10-21 22:08:55.525 25027 26921 E unknown:ReactNative: at android.os.Handler.dispatchMessage(Handler.java:98)
10-21 22:08:55.525 25027 26921 E unknown:ReactNative: at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:29)
10-21 22:08:55.525 25027 26921 E unknown:ReactNative: at android.os.Looper.loop(Looper.java:164)
10-21 22:08:55.525 25027 26921 E unknown:ReactNative: at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:192)
10-21 22:08:55.525 25027 26921 E unknown:ReactNative: at java.lang.Thread.run(Thread.java:764)
10-21 22:08:55.599 2098 2098 E KeyBoardInfoUtils-Japan: getInstance start
10-21 22:08:58.352 626 626 E hw-IPCThreadState: binder thread pool (1 threads) starved for 106 ms
10-21 22:09:24.059 1351 2202 E Watchdog: !@Sync 38 [2018-10-21 22:09:24.058]
10-21 22:09:25.302 10427 10427 E adbd : recv: OPEN 00000080 00000000 0047:73 68 65 6C 6C 2C 76 32 2C 54 45 52 4D 3D 78 74 65 72 6D 2D 32 35 36 63 6F 6C 6F 72 3A 65 78 70 6F 72 74 20 41 4E 44 52 4F 49 44 5F 4C 4F 47 5F 54 41 47 53 3D 22 27 27 22 3B 20 65 78 65 63 20 6C 6F 67 63 61 74 00
10-21 22:09:25.304 10427 10427 E adbd : service_to_fd: shell,v2,TERM=xterm-256color:export ANDROID_LOG_TAGS="’’"; exec logcat
10-21 22:09:25.333 26959 26959 E propClient: PropClient failed to load


#6

I just imported this line
import “./react/features/base/lib-jitsi-meet/_”;

inde index.js in react-native starting point.

After doing this, I am using this line in a main file.
import JitsiMeetJS from ‘…/…/react/features/base/lib-jitsi-meet/_’;

This is totally working in iOS. I can have a video conference with web and iOS.


#7

I found the error location by uncommenting in the js files.

uncomment this line solves this problem perfectly. I can have a viceo conference!!

Anyway, thanks for nice OSS and quick response!

But, I don’t know why this happens…
https://github.com/ocetnik/react-native-background-timer is related to this issue.


#8

Now, I know the react-native integration for iOS and Android in lib-jitsi-meet.
I will share the info. I think that many peole want to know this info.


#9

Glad you figured it out!

The error is quite unexpected to be honest, we are running that for over a year now, and have never seen this.

I wonder if the JSC update would solve this. (See how we run an updated JSC on Android on Jitsi Meet)

Cheers,


#10

Thanks.

For JSC update, it is the same result(error)

I followed



#11

I think I know what the problem might be. We use xxx.native.js for iOS and Android code, and unless you configure .flowconfig to do the same, you are going to be importing things from the wrong place.

Check how Jitsi Meet uses the .native.js extension.

PS: What you are trying to do is not something we are supporting or encouraging at the moment, so you are in uncharted territory.


#12

Okay, I see. will look into that part deeply.