skrafft / react-native-jitsi-meet

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

App crashes on Xcode 13 when used with reanimated #312

Open dgreasi opened 3 years ago

dgreasi commented 3 years ago

After updating to the latest Xcode 13 it seems that when "react-native-jitsi-meet", "react-native-reanimated" are used together the build fails with a weird error.

134523831-1929f1e3-abb2-4e2c-892f-d5b80a55117f

A reproducible repo can be found here

There is also an issue in reanimated for the same reason, which can be found here

dogukan9 commented 3 years ago

I got same issue please I need your help. Reanimated and Jitsi crushes

icc-romeu commented 3 years ago

Just in case it helps to solve the problem, I have been digging around and I found that Jitsi Meet SDK uses react native and it includes React Native Reanimated for some UI libraries:

# npm ls react-native-reanimated
jitsi-meet@0.0.0 /Users/pablo/projects/jitsi-meet
├─┬ @react-navigation/material-top-tabs@5.3.19
│ └── react-native-reanimated@1.13.3 deduped
├── react-native-reanimated@1.13.3
└─┬ react-native-tab-view@2.16.0
  └── react-native-reanimated@1.13.3 deduped

And, of course, it is a really old version. Current one is 2.2.4. By the way, both dependencies (material-top-tabs and react-native-tab-view) have newer version without these dependencies.

On the other hand, If you look at your debugger once you run your App you will see messages like this, because JitsiMeet SDK embeds react native:

[...]
objc[982]: Class RNCConnectionStateWatcher is implemented in both /private/var/containers/Bundle/Application/5E1ED691-F20A-44E8-A3B5-2BD6315BCA4D/someappName/Frameworks/JitsiMeet.framework/JitsiMeet (0x1081bd740) and /private/var/containers/Bundle/Application/5E1ED691-F20A-44E8-A3B5-2BD6315BCA4D/some.app/someappName 
(0x104053168). One of the two will be used. Which one is undefined.
objc[982]: Class RNCNetInfo is implemented in both

After this, I tested some changes and I have found that:

Hence, it seems that the problem is with Jitsi Meet that includes a version of reanimated that clashes with the one in the react native project. Maybe this worked at some point in time in the past... but not now with Xcode 13.

riyas145 commented 2 years ago

@bortolilucas @g3vxy not working for latest RN Version please tell me how to fix that issue

bortolilucas commented 2 years ago

@bortolilucas @g3vxy not working for latest RN Version please tell me how to fix that issue

Apparently Jitsi Meet SDK only supports RN Version <= 0.63. To fix it, you'll need to downgrade to RN 0.63. You can see the issue here #10192

ThaungThanHan commented 2 years ago

It works when I uninstalled reanimated library version 1 or version 2. None of them works. Please help if you have solution because It is not feasible for me to uninstall reanimated library since a lot of libraries are depending on it.

riyas145 commented 2 years ago

@ThaungThanHan @bortolilucas Im also facing same issue app get crashed when i use reanimated with any other plugins only jisti then it's working fine

ThaungThanHan commented 2 years ago

@riyas145 True. I even use the same version of reanimated 1.13.3 but no luck so far.

riyas145 commented 2 years ago

Yes same here pls let me know if u found any solution

icc-romeu commented 2 years ago

We finally ended up creating a wrapper over lib-jitsi-meet The main repo of Jitsi has the needed polyfills. Follow the "index.native.js" and you will find all you need: https://github.com/jitsi/jitsi-meet/tree/master/react

riyas145 commented 2 years ago

@icc-romeu can u please explain this how can I use this into my react native project

icc-romeu commented 2 years ago

TBH I do not have a step by step list but I got information from here:

The most important bits are the polyfills (that you have here: https://github.com/jitsi/jitsi-meet/tree/master/react ) and the dependencies. This user did setup it successfully https://github.com/jitsi/lib-jitsi-meet/issues/712#issuecomment-379134435

Take into account that lib-jitsi-meet is the underlying service to handle calls. You will have to create your own UI

TacticCoder commented 2 years ago

Same here