Skip to content

React Native Application stuck in init / black screen of death for iOS Simulator #4549

Open
@CarlosELopez

Description

@CarlosELopez

What React Native libraries do you use?

Hermes, React Navigation

Are you using sentry.io or on-premise?

on-premise (Self-Hosted)

@sentry/react-native SDK Version

6.3.0

How does your development environment look like?

System:
  OS: macOS 15.3
  CPU: (10) arm64 Apple M1 Pro
  Memory: 116.03 MB / 32.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 18.20.5
    path: /opt/homebrew/bin/node
  Yarn:
    version: 1.22.19
    path: /opt/homebrew/bin/yarn
  npm:
    version: 10.8.2
    path: /opt/homebrew/bin/npm
  Watchman: Not Found
Managers:
  CocoaPods:
    version: 1.16.2
    path: /opt/homebrew/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 24.2
      - iOS 18.2
      - macOS 15.2
      - tvOS 18.2
      - visionOS 2.2
      - watchOS 11.2
  Android SDK:
    API Levels:
      - "28"
      - "29"
      - "30"
      - "31"
      - "33"
      - "34"
      - "35"
    Build Tools:
      - 28.0.3
      - 30.0.2
      - 30.0.3
      - 33.0.0
      - 33.0.1
      - 33.0.3
      - 34.0.0
      - 35.0.0
      - 35.0.1
    System Images:
      - android-34 | Google APIs ARM 64 v8a
      - android-VanillaIceCream | Google Play ARM 64 v8a
    Android NDK: Not Found
IDEs:
  Android Studio: 2024.2 AI-242.23339.11.2421.12550806
  Xcode:
    version: 16.2/16C5032a
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.13
    path: /Users/clopez32/.jenv/shims/javac
  Ruby:
    version: 3.4.1
    path: /opt/homebrew/opt/ruby/bin/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.3.1
    wanted: 18.3.1
  react-native:
    installed: 0.75.4
    wanted: 0.75.4
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: true
  newArchEnabled: false

package.json "@sentry/react-native": "6.0.0", // used to be "6.3.0", but I'm playing with it.

yarn list --depth=0
 |─ @sentry-internal/[email protected]
├─ @sentry-internal/[email protected]
├─ @sentry-internal/[email protected]
├─ @sentry-internal/[email protected]
├─ @sentry/[email protected]
├─ @sentry/[email protected]
├─ @sentry/[email protected]
├─ @sentry/[email protected]
├─ @sentry/[email protected]
├─ @sentry/[email protected]
├─ @sentry/[email protected]
├─ @sentry/[email protected]
├─ @sentry/[email protected]
├─ @sentry/[email protected]
├─ @sentry/[email protected]
├─ @sentry/[email protected]
├─ @sentry/[email protected]
├─ @sentry/[email protected]
├─ @sentry/[email protected]
  - RNSentry (6.7.0):
    - DoubleConversion
    - glog
    - hermes-engine
    - RCT-Folly (= 2024.01.01.00)
    - RCTRequired
    - RCTTypeSafety
    - React-Core
    - React-debug
    - React-Fabric
    - React-featureflags
    - React-graphics
    - React-hermes
    - React-ImageManager
    - React-NativeModulesApple
    - React-RCTFabric
    - React-rendererdebug
    - React-utils
    - ReactCodegen
    - ReactCommon/turbomodule/bridging
    - ReactCommon/turbomodule/core
    - Sentry/HybridSDK (= 8.44.0)
    - Yoga
- Sentry/HybridSDK (8.44.0)

Sentry.init()

export const SENTRY_INTEGRATIONS = [
  Sentry.reactNavigationIntegration({
     enableTimeToInitialDisplay: true,
  }),
  entry.appStartIntegration({ standalone: true}),
  Sentry.reactNativeTracingIntegration(),
];

Sentry.init({
  dsn: '### self hosted',
  environment,
  release: sentryReleaseVersion,
  sampleRate: 0.05, // Error rate
  tracesSampleRate: 0.05, // Transactions
  profilesSampleRate: 1.0, // relative to tracesSampleRate, capture profile info.
  integrations: SENTRY_INTEGRATIONS,
  enableCaptureFailedRequests: true,
  enableAutoSessionTracking: true,
  attachStacktrace: true,
  enableAutoPerformanceTracing: true,
  enableUserInteractionTracing: true,
  attachViewHierarchy: true,
});

Steps to Reproduce

  • yarn install --reset--cache
  • cd ios && pod install
  • cd .. && yarn start
  • My app runs on Rosetta/x86. Build and Run from Xcode.

This started happening over the last two-three days for my local development setup. It was working fine before.

I am working against an iOS Simulator. When I start my app on the simulator, my applications gets stuck on a black screen after the splash screen. The JS Bundle downloads from metro, but it seems the app never starts.

As an experiment, I ran my app against my physical device. While connected to Xcode and Metro locally, I get the same hung result.
When I disconnect my device and just run the build, it eventually starts.

As an experiment I removed Sentry completely and it brings it back to life.

As an experiment, I downgraded to version 5.34.0 I get a different crash, but the application seems to start and respond. I have tried using @sentry/react-native version 6.3.0, 6.6.0, 6.7.0 but I'm currently getting the exact same result.

To gather more info, I pause execution from Xcode, I see the com.facebook.react.Javascript thread is stuck on something related to Hermes profiling. I don't get a stack trace or crash message from Xcode.

Image

Image

Image

Expected Result

App starts up and I can see it. This only happens when I remove Sentry pods completely or when I run on my device independently.

Actual Result

I get a black screen of death and a hang on RN Sentry in iOS simulator.

Image

Metadata

Metadata

Assignees

Type

Projects

  • Status

    In Investigation
  • Status

    No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions