[dev-client][splash-screen] Fix error when running with new arch mode on android #19931
+31
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why
when turning on new architecture mode with dev-client, there is a runtime crash:
fixes #19866
How
react-native has a singleton flag
ReactFeatureFlags.useTurboModules
. even though we have theReactNativeHost
with old architecture mode in dev-menu and dev-launcher, the underlyingCatalystInstanceImpl
will still fail at the check. theReactPackageTurboModuleManagerDelegate.Builder
requires some c++ code, considering we don't support new architecture mode in dev-menu and dev-launcher, this pr uses a workaround to pass theReactPackageTurboModuleManagerDelegate.Builder
from MainApplication.when running on new architecture mode, there is a NPE in
FrameLayout.onMeasure
. since splash screen view remove itself inViewGroup.OnHierarchyChangeListener
. the child iteration will get null fromgetChildAt()
. the pr tries to remove the splash screen view from the next run loop.Test Plan
Checklist
expo prebuild
& EAS Build (eg: updated a module plugin).