Skip to content

Commit

Permalink
Load Required Libraries in ReactBridge's static init (#910)
Browse files Browse the repository at this point in the history
* Load Required Libraries in ReactBridge's static init

This change was there in RN63 and was removed in RN64 as an optimization.
However, this is a probable root cause for a regression. Hence adding the
patch again

* Add few more libraries to be loaded in ReactBridge

Co-authored-by: Mayuresh Gharpure <Mayuresh.Gharpure@microsoft.com>
  • Loading branch information
msgharpu and Mayuresh Gharpure committed Nov 23, 2021
1 parent 68f067c commit ea8ae98
Showing 1 changed file with 28 additions and 0 deletions.
@@ -0,0 +1,28 @@
--- a/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactBridge.java
+++ b/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactBridge.java
@@ -31,6 +31,25 @@ public class ReactBridge {
Systrace.beginSection(
TRACE_TAG_REACT_JAVA_BRIDGE, "ReactBridge.staticInit::load:reactnativejni");
ReactMarker.logMarker(ReactMarkerConstants.LOAD_REACT_NATIVE_SO_FILE_START);
+
+ // JS Engine is configurable.. And we exepct only one packaged
+ // Hence ignore failure
+ try {
+ SoLoader.loadLibrary("hermes");
+ }catch (UnsatisfiedLinkError jscE){}
+
+ try {
+ SoLoader.loadLibrary("v8jsi");
+ }catch (UnsatisfiedLinkError jscE){}
+
+ SoLoader.loadLibrary("glog");
+ SoLoader.loadLibrary("glog_init");
+ SoLoader.loadLibrary("fb");
+ SoLoader.loadLibrary("fbjni");
+ SoLoader.loadLibrary("yoga");
+ SoLoader.loadLibrary("folly_json");
+ SoLoader.loadLibrary("reactperfloggerjni");
+ SoLoader.loadLibrary("jsinspector");
SoLoader.loadLibrary("reactnativejni");
ReactMarker.logMarker(ReactMarkerConstants.LOAD_REACT_NATIVE_SO_FILE_END);
Systrace.endSection(TRACE_TAG_REACT_JAVA_BRIDGE);

0 comments on commit ea8ae98

Please sign in to comment.