Skip to content

ANR: art::gc::Heap::WaitForGcToCompleteLocked - Input dispatching timed out (io.sentry:sentry-android:8.27.0) #5505

@thisisadarshjaiswal

Description

@thisisadarshjaiswal

What React Native libraries do you use?

React Native without Frameworks

Are you using sentry.io or on-premise?

sentry.io (SaS)

@sentry/react-native SDK Version

7.x.x (React Native) with io.sentry:sentry-android:8.27.0

How does your development environment look like?

⬇  Place the `npx react-native@latest info` output here. ⬇

App: Loadshare Delivery Partner App (v12.7, build 307)
Minimum API: Unknown
Target API: Android 15 (SDK 35)
React Native: Latest version via Expo or standard RN


Sentry.init()

Sentry.init({
dsn: "YOUR_DSN_HERE",
integrations: [new ReactNativeTracing()],
tracesSampleRate: 1.0,
// ... other configuration
});

Steps to Reproduce

The ANR is observed on the Loadshare Delivery Partner App when using Sentry Android SDK 8.27.0.

From Google Play Console Crash Logs:

  • Crash occurs on: Oppo A5 5G with Android 15 (SDK 35)
  • App version: 12.7 (build 307)
  • 55 affected users in last 28 days
  • Last occurred: 25 hours ago
  • Issue in production

Stack Trace Shows:
The main thread is stuck waiting in art::gc::Heap::WaitForGcToCompleteLocked which is triggered during View creation in React Native's ReactViewManager.createViewInstance().

The crash is reported as "Input dispatching timed out" ANR during UI operation.

Expected Result

The app should not experience ANR (Application Not Responding) crashes when Sentry is integrated with Sentry Android SDK 8.27.0.

Expected behavior:

  • No Input dispatching timeout ANR crashes
  • Smooth UI rendering without garbage collection blocking on the main thread
  • Sentry session replay or other features should not cause memory pressure that triggers prolonged GC pauses

Actual Result

Actual behavior from Google Play Console:

ANR crash: [libart.so] art::gc::Heap::WaitForGcToCompleteLocked
Error message: "Input dispatching timed out"

Crash Details:

  • Affected App: Loadshare Delivery Partner App v12.7 (build 307)
  • Affected Device: Oppo A5 5G with Android 15 (SDK 35)
  • Affected Users: 55 in last 28 days
  • Stack trace shows the main thread is blocked waiting for garbage collection to complete during View creation
  • This occurs in com.facebook.react.views.view.ReactViewManager.createViewInstance()
  • The ANR prevents the input dispatcher from responding, causing watchdog to kill the app

Root Cause Analysis:
The issue appears to be related to GC pressure when using Sentry Android SDK 8.27.0 with Session Replay or other integrations that may allocate significant memory, causing prolonged GC pauses on the main thread during UI operations.

Metadata

Metadata

Assignees

No one assigned

    Projects

    Status

    Waiting for: Product Owner

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions