Commit 874332b
authored
fix: make sure native libs are loaded for RN >= 0.80 (#315)
* fix: make sure native libs are loaded for RN >= 0.80
cause: loadNativeLibs() in ReactNativeBrownfield.kt is a no-op for RN >= 0.80.
All ReactNativeHostManager templates call loadReactNative(application) BEFORE
ReactNativeBrownfield.initialize(), so when done through the recommended path the libs load. But
loadNativeLibs() — called inside every initialize() overload — silently skips for RN >= 0.80. Any
consumer using ReactNativeBrownfield.initialize() directly — with a custom ReactHost, custom
packages list, or custom options — skipped native lib loading entirely. Without JNI_OnLoad firing,
registerComponentDescriptorsFromEntryPoint and the DefaultTurboModuleManagerDelegate module
providers were never assigned, leading to the SIGSEGV during Fabric initialization.
ddc011c — moved SoLoader.init() from preloadReactNative() into
initialize(application, rnHost, ...). Before this, SoLoader.init() was called inside
preloadReactNative after creating the React context. It was consolidated into the initialize entry
point.
9908b68 — added the RN_THRESHOLD_VERSION = "0.80.0" gate and removed SoLoader.init() + load() for
RN ≥ 0.80, leaving those calls only for < 0.80.
ReactNativeBrownfield.initialize() itself had no fallback for the RN ≥ 0.80 case. If anything
bypasses ReactNativeHostManager — a custom ReactHost, a consumer calling initialize() directly, or
the generated ReactNativeApplicationEntryPoint being unavailable — native libs are never loaded.
That's the bug this fix addresses.
* docs: add changeset
* fix: address compilation issue
* fix: drop support for RN < 0.80
* fix: get rid of redundant (now) PG config1 parent a4de8d2 commit 874332b
6 files changed
Lines changed: 15 additions & 22 deletions
File tree
- .changeset
- apps/RNApp/android/BrownfieldLib
- src/main/java/com/rnapp/brownfieldlib
- packages/react-native-brownfield
- android/src/main/java/com/callstack/reactnativebrownfield
- src/expo-config-plugin/template/android
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
Whitespace-only changes.
Lines changed: 0 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | 7 | | |
9 | 8 | | |
10 | 9 | | |
11 | | - | |
12 | | - | |
13 | 10 | | |
14 | 11 | | |
15 | 12 | | |
| |||
Lines changed: 10 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | 10 | | |
12 | 11 | | |
13 | 12 | | |
| |||
28 | 27 | | |
29 | 28 | | |
30 | 29 | | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | 30 | | |
39 | 31 | | |
40 | 32 | | |
41 | 33 | | |
42 | 34 | | |
43 | 35 | | |
| 36 | + | |
44 | 37 | | |
45 | 38 | | |
46 | 39 | | |
47 | 40 | | |
48 | 41 | | |
49 | 42 | | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
| 43 | + | |
| 44 | + | |
55 | 45 | | |
56 | 46 | | |
57 | 47 | | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
58 | 53 | | |
59 | 54 | | |
60 | 55 | | |
| |||
79 | 74 | | |
80 | 75 | | |
81 | 76 | | |
| 77 | + | |
| 78 | + | |
82 | 79 | | |
83 | 80 | | |
84 | 81 | | |
| |||
Lines changed: 0 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | 9 | | |
11 | 10 | | |
12 | 11 | | |
13 | 12 | | |
14 | 13 | | |
15 | | - | |
16 | | - | |
17 | 14 | | |
18 | 15 | | |
19 | 16 | | |
| |||
Lines changed: 0 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | 9 | | |
11 | 10 | | |
12 | 11 | | |
| |||
15 | 14 | | |
16 | 15 | | |
17 | 16 | | |
18 | | - | |
19 | | - | |
20 | 17 | | |
21 | 18 | | |
22 | 19 | | |
| |||
0 commit comments