Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CxxReactPackage: Load So's during class loads (#41674)
Summary: Pull Request resolved: #41674 The problem: The Java runtime couldn't find CatalystCxxReactPackage.initHybrid. Why: I think is because CxxReactPackage loads CatalystCxxReactPackage's so in its constructor. This might be too late to load the derived class's so. So, I just switched derived delegates to load the so in the static initializer (i.e: the recomended approch for so loading): https://www.internalfb.com/code/fbsource/[91c4e41c49ed191ac864250ccaec52c01ddaeccc]/fbandroid/libraries/soloader/java/com/facebook/soloader/SoLoader.java?lines=52-54%2C60-61%2C63-67 This way: 1. The So's are loaded plenty early (the method not found error went away). 2. We don't create our own so loading infra, which complicates this abstraction, and makes it harder to work with, even more. Changelog: [Internal] Reviewed By: javache Differential Revision: D51550622 fbshipit-source-id: f4782d6fa9387f21fbf611191e9483e2a58b3a34
- Loading branch information