-
Notifications
You must be signed in to change notification settings - Fork 24.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dev app crashes when switching color scheme while Text element with DynamicColorIOS is used #48493
Comments
Tip Newer version available: You are on a supported minor version, but it looks like there's a newer patch available - 0.76.5. Please upgrade to the highest patch for your minor or latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If it does not repro, please let us know so we can close out this issue. This helps us ensure we are looking at issues that still exist in the most recent releases. |
Tip Newer version available: You are on a supported minor version, but it looks like there's a newer patch available - undefined. Please upgrade to the highest patch for your minor or latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If it does not repro, please let us know so we can close out this issue. This helps us ensure we are looking at issues that still exist in the most recent releases. |
Not only More investgation:
|
Hi , I have a PR to fix another similar crash #48496. Actually, I don't repro using your reproducer, can you please test wether my fix also works for your issue? |
@zhongwuzw Thanks! I applied your changes manually to my reproducer Pods, but unfortunately, it still happens. Screen.Shot.2025-01-05.10.01.28.PM.Xcode.mp4If you have the time, can you help to confirm that when you run the reproducer, did it reach that When I was preparing the reproducer, I found reproducing challenging since many things will prevent it from happening, such as if the JS bundle has been reloaded or hot updated, it may not occur. If possible, I would like to improve the reproducer or instructions and make it easier to reproduce. |
@zetavg Hi, I reproduced the crash successfully, but if I applied my changes, seems it not crash any more[ps, crash again if removed my changes]. Can you generate a patch after you applied my changes that I can investigate it ? :) |
@zhongwuzw Many thanks, I applied your changes again, and it works now! And I can confirm the same, if I change IDK why it didn't work for the first time, maybe I missed something. My files that made it work
(Look for the
|
Description
The React Native app in development mode will crash when switching the color scheme (through system or the app) while there's a
Text
element usingDynamicColorIOS
. (seeApp.tsx
in repro)The error message shown in Xcode is:
(It's a
FOLLY_SAFE_DCHECK
assertion written here)Stack trace shows the assertion failure occurs while calling
_cache.get
here inRCTTextLayoutManager.mm
:Fun fact is that due to the assertion statement
(self.size() > 3 || ...)
, if we add moreText
elements on the screen, the app won't crash.This also doesn't affect release builds since that assertion seems to be dev-only.
Steps to reproduce
React Native Version
0.76.0, 0.76.4, 0.76.5
Affected Platforms
Runtime - iOS
Areas
(not sure) Fabric - The New Renderer
Output of
npx react-native info
Stacktrace or Logs
Reproducer
https://github.com/zetavg/rn-crash-DynamicColorIOS-color-scheme-switch
Screenshots and Videos
The text was updated successfully, but these errors were encountered: