Commit 7facb32
Remove core modules from the default tmmdelegate (#43939)
Summary:
Pull Request resolved: #43939
## Problem
If we link the default tmmdelegate with our vr apps, we get this issue:
```
ld.lld: error: duplicate symbol: facebook::react::NativeDevLoadingViewSpecJSI::NativeDevLoadingViewSpecJSI(facebook::react::JavaTurboModule::InitParams const&)
>>> defined at firsttimenux_v2AppModulesCodegen-generated.cpp:1367 (buck-out/v2/gen/fbsource/bcbe7a50bd5ff29a/arvr/libraries/react-panellib/FirstTimeNux/__firsttimenux_v2AppModulesCodegen-codegen-modules-jni_cpp__/out/firsttimenux_v2AppModulesCodegen-generated.cpp:1367)
>>> firsttimenux_v2AppModulesCodegen-generated.cpp.pic.o:(facebook::react::NativeDevLoadingViewSpecJSI::NativeDevLoadingViewSpecJSI(facebook::react::JavaTurboModule::InitParams const&)) in archive buck-out/v2/gen/fbsource/bcbe7a50bd5ff29a/arvr/libraries/react-panellib/FirstTimeNux/__firsttimenux_v2AppModulesCodegen-jni__/libfirsttimenux_v2AppModulesCodegen-jni.pic.a
>>> defined at rncore-generated.cpp:606 (buck-out/v2/gen/fbsource/bcbe7a50bd5ff29a/xplat/js/react-native-github/__rncore-codegen-modules-jni_cpp__/out/rncore-generated.cpp:606)
>>> rncore-generated.cpp.pic.o:(.text._ZN8facebook5react27NativeDevLoadingViewSpecJSIC2ERKNS0_15JavaTurboModule10InitParamsE+0x0) in archive buck-out/v2/gen/fbsource/bcbe7a50bd5ff29a/xplat/js/react-native-github/__rncore-jniAndroid__/librncore-jniAndroid.pic.a
```
## Cause
My best understanding of the problem:
- Default tmmdelegate links against rncore, which contains codegen for react native's standard library of modules.
- But, the default delegate also pulls in this appmodules.so library. That library also contains codegen for react native's standard library of modules + the app's modules.
So, two so libraries define the same symbols. Hence the build fails.
## Solution
Remove the codegen for react native's standard library of modules from the default tmmdelegate.
Prereq: In open source, also make appmodules.so include the codegen for react native's standard library of modules.
Changelog: [Android][Breaking] - Make the app responsible for returning core turbomodule jsi hostobjects
Reviewed By: cortinico
Differential Revision: D55613024
fbshipit-source-id: 6406a9f388ff9de01288de0e263a78a079e7a0da1 parent a0d809c commit 7facb32
3 files changed
Lines changed: 20 additions & 3 deletions
File tree
- packages
- react-native/ReactAndroid
- cmake-utils/default-app-setup
- src/main/jni/react/newarchdefaults
- rn-tester/android/app/src/main/jni
Lines changed: 11 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
| |||
95 | 96 | | |
96 | 97 | | |
97 | 98 | | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
98 | 104 | | |
99 | | - | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
100 | 110 | | |
101 | 111 | | |
102 | 112 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
16 | 15 | | |
17 | 16 | | |
18 | 17 | | |
| |||
100 | 99 | | |
101 | 100 | | |
102 | 101 | | |
103 | | - | |
| 102 | + | |
| 103 | + | |
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
51 | 52 | | |
52 | 53 | | |
53 | 54 | | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
54 | 61 | | |
55 | 62 | | |
56 | 63 | | |
| |||
0 commit comments