Skip to content

ANR Due to StatusBar #48375

Description

@Endagorion-Peter

Description

We are getting ANR while using StatusBar from react-native. We are using it in our App.tsx like following:

<>
  <StatusBar barStyle='dark-content' hidden />
  <ErrorBoundary>
    <GestureHandlerRootView style={styles.flex1}>
      <PortalProvider>
        <SafeAreaView style={styles.safeAreaView} edges={['right', 'left', 'top']}>
          <View style={styles.background}>
            <Provider store={store}>
              <TooltipLib.TooltipManager>
                <View style={styles.background}>
                  <NavigationContainer
                    ref={navigationGlobalRef}
                    theme={DarkTheme}
                    onStateChange={logActiveRouteName}
                  >
                    <AppNavigationContainer />
                  </NavigationContainer>
                  <PortalHost name='onboardingNudge' />
                  <GeneralOptions />
                  <PortalHost name='modals' />
                  <StartupTime setAppStartupTime={setAppStartupTime} />
                </View>
              </TooltipLib.TooltipManager>
              <PerformanceStats />
              <LoggerPersistence />
            </Provider>
          </View>
        </SafeAreaView>
      </PortalProvider>
    </GestureHandlerRootView>
  </ErrorBoundary>
</>

Stack-Trace:

"main" tid=1 Native

#00 pc 0x000000000005dd10 /apex/com.android.runtime/lib/bionic/libc.so (syscall+28)
#1 pc 0x00000000002106af /apex/com.android.art/lib/libart.so (art::ConditionVariable::WaitHoldingLocks+86)
#2 pc 0x000000000059d64d /apex/com.android.art/lib/libart.so (artJniMethodEnd+312)
#3 pc 0x00000000000a3d89 /apex/com.android.art/lib/libart.so (art_jni_method_end+8)
at android.os.BinderProxy.transactNative (Native method)
at android.os.BinderProxy.transact (BinderProxy.java:599)
at android.app.IActivityClientController$Stub$Proxy.setTaskDescription (IActivityClientController.java:2078)
at android.app.ActivityClient.setTaskDescription (ActivityClient.java:432)
at android.app.Activity.setTaskDescription (Activity.java:7531)
at android.app.Activity$1.updateStatusBarColor (Activity.java:1092)
at com.android.internal.policy.PhoneWindow.setStatusBarColor (PhoneWindow.java:3874)
at com.facebook.react.modules.statusbar.StatusBarModule$1.runGuarded (StatusBarModule.java:108)
at com.facebook.react.bridge.GuardedRunnable.run (GuardedRunnable.java:30)
at android.os.Handler.handleCallback (Handler.java:958)
at android.os.Handler.dispatchMessage (Handler.java:99)
at android.os.Looper.loopOnce (Looper.java:205)
at android.os.Looper.loop (Looper.java:294)
at android.app.ActivityThread.main (ActivityThread.java:8492)
at java.lang.reflect.Method.invoke (Native method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:640)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1026)

Looks like ANR is produced while setting color of status-bar.

Steps to reproduce

NA

React Native Version

0.71.13

Affected Platforms

Runtime - Android

Output of npx react-native info

NA

Stacktrace or Logs

NA

Reproducer

https://github.com/Endagorion-Peter

Screenshots and Videos

NA

Activity

  1. react-native-bot commented on Dec 23, 2024

    @react-native-bot
    Collaborator

    Caution

    Too old version: It looks like your issue or the example you provided uses a Too Old Version of React Native.

    Due to the number of issues we receive, we're currently only accepting new issues against one of the supported versions. Please upgrade to latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If you cannot upgrade, please open your issue on StackOverflow to get further community support.

  2. react-native-bot commented on Dec 23, 2024

    @react-native-bot
    Collaborator

    Warning

    Missing reproducer: We could not detect a reproducible example in your issue report. Please provide either:

  3. react-native-bot commented on Dec 23, 2024

    @react-native-bot
    Collaborator

    Caution

    Too old version: It looks like your issue or the example you provided uses a Too Old Version of React Native.

    Due to the number of issues we receive, we're currently only accepting new issues against one of the supported versions. Please upgrade to latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If you cannot upgrade, please open your issue on StackOverflow to get further community support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions