jitsi / jitsi-meet

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.
https://jitsi.org/meet
Apache License 2.0
21.97k stars 6.56k forks source link

App crashes when using Jitsi with Hermes enabled #14752

Open Abhishek-Khanduri opened 4 weeks ago

Abhishek-Khanduri commented 4 weeks ago

Description:

In my React Native application with Hermes enabled, the app crashes when a user joins the room or when more than two users join the room. I fixed this issue by disabling Hermes, but now it crashes on some Android 10 devices.

Expected behavior:

The app should work with Hermes enabled.

Actual behavior:

The app crashes when Hermes is enabled and a user joins a room, or when more than two users join a room.

Server information:

Client information:

Additional information:

This is the error trace I get when I enable hermes and run the app in release mode, on Android Studio when I check the Android logs

[13:25:39] E | ReactNativeJS ▶︎ '2024-05-16T07:55:39.742Z', '[features/app]', [Error: Should not already be working.]

This is the error trace I'm encountering on some Android 10 devices after disabling Hermes to use Jitsi.

Fatal Exception: java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libhermes.so
    SoSource 0: com.facebook.soloader.DirectorySoSource[root = /data/app/org.mentortogether.mentorship-9_6Je2mR9rzeCcnmIT5ZoQ==/lib/arm64 flags = 0]
    SoSource 1: com.facebook.soloader.DirectApkSoSource[root = (/data/app/org.mentortogether.mentorship-9_6Je2mR9rzeCcnmIT5ZoQ==/base.apk!/lib/arm64-v8a, )]
    SoSource 2: com.facebook.soloader.DirectorySoSource[root = /system/lib64 flags = 2]
    SoSource 3: com.facebook.soloader.DirectorySoSource[root = /vendor/lib64 flags = 2]
    Native lib dir: /data/app/org.mentortogether.mentorship-9_6Je2mR9rzeCcnmIT5ZoQ==/lib/arm64
 result: 0
       at com.facebook.soloader.SoLoader.doLoadLibraryBySoName(SoLoader.java:1127)
       at com.facebook.soloader.SoLoader.loadLibraryBySoNameImpl(SoLoader.java:943)
       at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:855)
       at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:802)
       at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:772)
       at com.facebook.hermes.reactexecutor.HermesExecutor.loadLibrary(HermesExecutor.java:25)
       at com.facebook.hermes.reactexecutor.HermesExecutor.<clinit>(HermesExecutor.java:19)
       at com.facebook.react.ReactInstanceManagerBuilder.getDefaultJSExecutorFactory(ReactInstanceManagerBuilder.java:393)
       at com.facebook.react.ReactInstanceManagerBuilder.build(ReactInstanceManagerBuilder.java:343)
       at com.facebook.react.ReactNativeHost.createReactInstanceManager(ReactNativeHost.java:96)
       at com.facebook.react.ReactNativeHost.getReactInstanceManager(ReactNativeHost.java:42)
       at org.mentortogether.mentorship.MainApplication.onCreate(MainApplication.java:73)
       at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1190)
       at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6852)
       at android.app.ActivityThread.access$1300(ActivityThread.java:268)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1982)
       at android.os.Handler.dispatchMessage(Handler.java:107)
       at android.os.Looper.loop(Looper.java:237)
       at android.app.ActivityThread.main(ActivityThread.java:7807)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1047)
saghul commented 4 weeks ago

The last error suggests you haven't disabled Hermes properly since it's still looking for it.

Abhishek-Khanduri commented 4 weeks ago

@saghul Yes, that's the catch. It's working fine for most users after disabling Hermes. However, for some Android 10 devices, the error trace mentioned above is being logged on Crashlytics. I have also cleaned the Gradle before creating the bundle and also tried this multiple times on the internal testing environment and the same behavior there as well:

This is my app's gradle.properties where I have hermesEnabled=false

# Project-wide Gradle settings.

# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.

# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html

# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
# Default value: -Xmx512m -XX:MaxMetaspaceSize=256m
org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m

# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true

# AndroidX package structure to make it clearer which packages are bundled with the
# Android operating system, and which are packaged with your app's APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true

# Version of flipper SDK to use with React Native
FLIPPER_VERSION=0.125.0

# Use this property to specify which architecture you want to build.
# You can also override it from the CLI using
# ./gradlew <task> -PreactNativeArchitectures=x86_64
reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64

# Use this property to enable support to the new architecture.
# This will allow you to use TurboModules and the Fabric render in
# your application. You should enable this flag either if you want
# to write custom TurboModules/Fabric components OR use libraries that
# are providing them.
newArchEnabled=false

# Use this property to enable or disable the Hermes JS engine.
# If set to false, you will be using JSC instead.
hermesEnabled=false
android.disableAutomaticComponentCreation=true

Additionally, can't I use Jitsi with Hermes enabled?

saghul commented 4 weeks ago

I don't know why you see errors related to Hermes if you have disabled it. Sounds like an RN bug.

As for why you can't use it: you can try, but we don't use it so we won't be able to help you when it breaks.

Last we tried things didn't work out well so we keep using JSC.

mesutaltuncu commented 2 hours ago

Do you plan to enable hermes in the future?

saghul commented 2 hours ago

Yes, but it's a bit unclear when that would be.

I think once we update to RN 0.73 it might be worth it to try again.

mesutaltuncu commented 2 hours ago

Thanks, looking forward to it.