Android: generated ReactNativeHostManager loads React Native twice and crashes (Feature flags cannot be overridden more than once)
维护者通常 4 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 72/100
调研方向
从 expo-config-plugin 模板文件夹中生成的模板 ReactNativeHostManager.vanilla.kt 开始,并将其与 ReactNativeBrownfield.kt 进行比较,后者的 initialize 会调用 loadNativeLibs(SoLoader.init 和 DefaultNewArchitectureEntryPoint.load)。通过生成一个项目并启动应用来复现问题。当模板不再调用 loadReactNative(application),并且应用在没有功能开关错误的情况下启动时,即完成。
由索引模型根据 Issue 内容生成。
描述
The ReactNativeHostManager that the scaffold generates for a React Native CLI project crashes on start:
Feature flags cannot be overridden more than once
It calls loadReactNative(application) and then ReactNativeBrownfield.initialize(...) (ReactNativeHostManager.vanilla.kt). initialize already runs loadNativeLibs, which calls SoLoader.init and DefaultNewArchitectureEntryPoint.load() (ReactNativeBrownfield.kt), so React Native's feature flags are set twice.
Repro: npm create @callstack/react-native-brownfield@latest, package the AAR, and start React Native from a native app with the generated ReactNativeHostManager.initialize.
Fix: remove the loadReactNative(application) call from the template; initialize loads the native libraries itself. Removing it in the generated file makes the app start.
Tested with: @callstack/create-react-native-brownfield 5.3.0, React Native 0.85.2.
- 主要语言
- TypeScript
- 星标
- 552
- 派生
- 53
- 平均合并
- 4 天 13 小时
- 30 天内合并 PR
- 15
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
callstack/react-native-brownfield 的其他 Issue
-
难度 4/5 3-5 天 新手友好度 55/100
callstack/react-native-brownfield#468 ·
维护者通常 4 天内回复
-
难度 4/5 3-5 天 新手友好度 48/100
callstack/react-native-brownfield#420 ·
维护者通常 4 天内回复
-
难度 5/5 一周以上 新手友好度 38/100
callstack/react-native-brownfield#406 ·
维护者通常 4 天内回复
-
Common network layer可能重新可做 @dratwas 于 2541 天前认领,目前没有进行中的 PR。 未关闭
callstack/react-native-brownfield#23 · 已指派 1 人 ·
维护者通常 4 天内回复
-
Add support for bottom tabs可能重新可做 @krizzu 于 2541 天前认领,目前没有进行中的 PR。 未关闭
callstack/react-native-brownfield#22 · 已指派 1 人 ·
维护者通常 4 天内回复
查看 callstack/react-native-brownfield 的全部 Issue
相似的 Issue
-
afk-ok area:data-quality importer size:S
难度 2/5 1-3 小时 新手友好度 74/100
enorm-labs/event-junkie#3301 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
one-zero-eight/apply-bot#39 ·
-
难度 2/5 1-3 小时 新手友好度 72/100
bigbluebutton/bbb-ui-components-react#108 ·
维护者通常 2 天内回复
-
area: app type: bug
难度 2/5 1-3 小时 新手友好度 70/100
ExpidetGames/code-reviewer#308 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复