flexn-io / renative

🚀🚀🚀 Unified Development Platform for iOS, tvOS, Android, Android TV, Android Wear, Web, Tizen TV, Tizen Watch, Tizen Mobile, LG webOS, macOS/OSX, Windows, KaiOS, FirefoxOS Firefox TV platforms
https://renative.org
MIT License
1.82k stars 180 forks source link

Release instant curshes on Android on 0.37.3 #1156

Closed maciejsiiminski closed 1 year ago

maciejsiiminski commented 1 year ago

Describe the bug After upgrading the project to 0.37.3 from 0.36.1 release builds crush instantly with fatal exception java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libjscexecutor.so. I thought that some of the many plugins used in the project may be the reason for this crush so I checked on a new project with a template starter and the result was the same. Works perfectly on the debug version and crushes instantly on the release version. Switching the engine from Hermes to JSC fixes the issue but the app randomly becomes unresponsive on JSC so it is far from ideal.

To Reproduce

  1. Create new project supporting android.
  2. Run release build.

Expected behavior App does not crash

Screenshots or copy&paste Full error logs

10-10 16:12:57.500 11421 11421 E SoLoader: couldn't find DSO to load: libjscexecutor.so 10-10 16:12:57.500 11421 11421 E SoLoader: SoSource 0: com.facebook.soloader.ApkSoSource[root = /data/data/com.testpol.test/lib-main flags = 1] 10-10 16:12:57.500 11421 11421 E SoLoader: SoSource 1: com.facebook.soloader.DirectorySoSource[root = /data/app/~~OnqMkD_ms7OLoURjrm97cg==/com.testpol.test-UqkJ4UtouhYr-Sj61xzx7Q==/lib/arm64 flags = 0] 10-10 16:12:57.500 11421 11421 E SoLoader: SoSource 2: com.facebook.soloader.DirectorySoSource[root = /vendor/lib64 flags = 2] 10-10 16:12:57.500 11421 11421 E SoLoader: SoSource 3: com.facebook.soloader.DirectorySoSource[root = /system/lib64 flags = 2] 10-10 16:12:57.500 11421 11421 E SoLoader: Native lib dir: /data/app/~~OnqMkD_ms7OLoURjrm97cg==/com.testpol.test-UqkJ4UtouhYr-Sj61xzx7Q==/lib/arm64 10-10 16:12:57.500 11421 11421 E SoLoader: result: 0 10-10 16:12:57.530 11421 11421 E SoLoader: couldn't find DSO to load: libhermes-inspector.so caused by: dlopen failed: cannot locate symbol "_ZTIN8facebook6hermes8debugger13EventObserverE" referenced by "/data/data/com.testpol.test/lib-main/libhermes-inspector.so"... result: 0 10-10 16:12:57.531 11421 11421 E SoLoader: couldn't find DSO to load: libhermes-executor-common-debug.so caused by: couldn't find DSO to load: libhermes-inspector.so caused by: dlopen failed: cannot locate symbol "_ZTIN8facebook6hermes8debugger13EventObserverE" referenced by "/data/data/com.testpol.test/lib-main/libhermes-inspector.so"... result: 0 result: 0 10-10 16:12:57.532 11421 11421 E SoLoader: couldn't find DSO to load: libhermes-executor-debug.so caused by: couldn't find DSO to load: libhermes-executor-common-debug.so caused by: couldn't find DSO to load: libhermes-inspector.so caused by: dlopen failed: cannot locate symbol "_ZTIN8facebook6hermes8debugger13EventObserverE" referenced by "/data/data/com.testpol.test/lib-main/libhermes-inspector.so"... result: 0 result: 0 result: 0 10-10 16:12:57.533 11421 11421 E SoLoader: couldn't find DSO to load: libhermes-executor-release.so 10-10 16:12:57.533 11421 11421 E SoLoader: SoSource 0: com.facebook.soloader.ApkSoSource[root = /data/data/com.testpol.test/lib-main flags = 1] 10-10 16:12:57.533 11421 11421 E SoLoader: SoSource 1: com.facebook.soloader.DirectorySoSource[root = /data/app/~~OnqMkD_ms7OLoURjrm97cg==/com.testpol.test-UqkJ4UtouhYr-Sj61xzx7Q==/lib/arm64 flags = 0] 10-10 16:12:57.533 11421 11421 E SoLoader: SoSource 2: com.facebook.soloader.DirectorySoSource[root = /vendor/lib64 flags = 2] 10-10 16:12:57.533 11421 11421 E SoLoader: SoSource 3: com.facebook.soloader.DirectorySoSource[root = /system/lib64 flags = 2] 10-10 16:12:57.533 11421 11421 E SoLoader: Native lib dir: /data/app/~~OnqMkD_ms7OLoURjrm97cg==/com.testpol.test-UqkJ4UtouhYr-Sj61xzx7Q==/lib/arm64 10-10 16:12:57.533 11421 11421 E SoLoader: result: 0 10-10 16:12:57.535 11421 11421 E AndroidRuntime: FATAL EXCEPTION: main 10-10 16:12:57.535 11421 11421 E AndroidRuntime: Process: com.testpol.test, PID: 11421 10-10 16:12:57.535 11421 11421 E AndroidRuntime: java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libjscexecutor.so 10-10 16:12:57.535 11421 11421 E AndroidRuntime: SoSource 0: com.facebook.soloader.ApkSoSource[root = /data/data/com.testpol.test/lib-main flags = 1] 10-10 16:12:57.535 11421 11421 E AndroidRuntime: SoSource 1: com.facebook.soloader.DirectorySoSource[root = /data/app/~~OnqMkD_ms7OLoURjrm97cg==/com.testpol.test-UqkJ4UtouhYr-Sj61xzx7Q==/lib/arm64 flags = 0] 10-10 16:12:57.535 11421 11421 E AndroidRuntime: SoSource 2: com.facebook.soloader.DirectorySoSource[root = /vendor/lib64 flags = 2] 10-10 16:12:57.535 11421 11421 E AndroidRuntime: SoSource 3: com.facebook.soloader.DirectorySoSource[root = /system/lib64 flags = 2] 10-10 16:12:57.535 11421 11421 E AndroidRuntime: Native lib dir: /data/app/~~OnqMkD_ms7OLoURjrm97cg==/com.testpol.test-UqkJ4UtouhYr-Sj61xzx7Q==/lib/arm64 10-10 16:12:57.535 11421 11421 E AndroidRuntime: result: 0 10-10 16:12:57.535 11421 11421 E AndroidRuntime: at com.facebook.soloader.SoLoader.doLoadLibraryBySoName(SoLoader.java:896) 10-10 16:12:57.535 11421 11421 E AndroidRuntime: at com.facebook.soloader.SoLoader.loadLibraryBySoNameImpl(SoLoader.java:725) 10-10 16:12:57.535 11421 11421 E AndroidRuntime: at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:649) 10-10 16:12:57.535 11421 11421 E AndroidRuntime: at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:629) 10-10 16:12:57.535 11421 11421 E AndroidRuntime: at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:577) 10-10 16:12:57.535 11421 11421 E AndroidRuntime: at com.facebook.react.jscexecutor.JSCExecutor.loadLibrary(JSCExecutor.java:24) 10-10 16:12:57.535 11421 11421 E AndroidRuntime: at com.facebook.react.jscexecutor.JSCExecutor.(JSCExecutor.java:20) 10-10 16:12:57.535 11421 11421 E AndroidRuntime: at com.facebook.react.ReactInstanceManagerBuilder.getDefaultJSExecutorFactory(ReactInstanceManagerBuilder.java:352) 10-10 16:12:57.535 11421 11421 E AndroidRuntime: at com.facebook.react.ReactInstanceManagerBuilder.build(ReactInstanceManagerBuilder.java:319) 10-10 16:12:57.535 11421 11421 E AndroidRuntime: at com.facebook.react.ReactNativeHost.createReactInstanceManager(ReactNativeHost.java:95) 10-10 16:12:57.535 11421 11421 E AndroidRuntime: at com.facebook.react.ReactNativeHost.getReactInstanceManager(ReactNativeHost.java:42) 10-10 16:12:57.535 11421 11421 E AndroidRuntime: at com.facebook.react.ReactDelegate.loadApp(ReactDelegate.java:104) 10-10 16:12:57.535 11421 11421 E AndroidRuntime: at com.facebook.react.ReactActivityDelegate.loadApp(ReactActivityDelegate.java:91) 10-10 16:12:57.535 11421 11421 E AndroidRuntime: at com.facebook.react.ReactActivityDelegate.onCreate(ReactActivityDelegate.java:86) 10-10 16:12:57.535 11421 11421 E AndroidRuntime: at com.facebook.react.ReactActivity.onCreate(ReactActivity.java:46) 10-10 16:12:57.535 11421 11421 E AndroidRuntime: at com.testpol.test.MainActivity.onCreate(MainActivity.kt:20) 10-10 16:12:57.535 11421 11421 E AndroidRuntime: at android.app.Activity.performCreate(Activity.java:8545) 10-10 16:12:57.535 11421 11421 E AndroidRuntime: at android.app.Activity.performCreate(Activity.java:8509) 10-10 16:12:57.535 11421 11421 E AndroidRuntime: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1437) 10-10 16:12:57.535 11421 11421 E AndroidRuntime: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3881) 10-10 16:12:57.535 11421 11421 E AndroidRuntime: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:4046) 10-10 16:12:57.535 11421 11421 E AndroidRuntime: at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:101) 10-10 16:12:57.535 11421 11421 E AndroidRuntime: at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) 10-10 16:12:57.535 11421 11421 E AndroidRuntime: at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) 10-10 16:12:57.535 11421 11421 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2440) 10-10 16:12:57.535 11421 11421 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:106) 10-10 16:12:57.535 11421 11421 E AndroidRuntime: at android.os.Looper.loopOnce(Looper.java:211) 10-10 16:12:57.535 11421 11421 E AndroidRuntime: at android.os.Looper.loop(Looper.java:300) 10-10 16:12:57.535 11421 11421 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:8315) 10-10 16:12:57.535 11421 11421 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method) 10-10 16:12:57.535 11421 11421 E AndroidRuntime: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:581) 10-10 16:12:57.535 11421 11421 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1028)

Desktop (please complete the following information):

Additional context I tested this issue on multiple Xiaomis with android 13.

pauliusguzas commented 1 year ago

@maciejsiiminski thanks for reporting, what exact command are you running?

maciejsiiminski commented 1 year ago

rnv run -p android -t <target's ip> -s production I managed to get rid of this error by replacing the {{INJECT_HERMES}} line in app/build.gradle with enableHermes: true, hermesCommand: "{{PATH_HERMES_ENGINE}}/%OS-BIN%/hermes" so basically by deleting deleteDebugFilesForVariant: { false } line. I don't know why did this worked but it did.