Skip to content
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

TestFlight/Production App Crashes immediately due to Reanimated #6859

Open
lorddegenx opened this issue Dec 29, 2024 · 3 comments
Open

TestFlight/Production App Crashes immediately due to Reanimated #6859

lorddegenx opened this issue Dec 29, 2024 · 3 comments
Labels
Missing info The user didn't precise the problem enough Missing repro This issue need minimum repro scenario Platform: iOS This issue is specific to iOS

Comments

@lorddegenx
Copy link

Description

Description

I'm experiencing a consistent crash in my React Native app running on TestFlight. The crash occurs immediately after app launch during the initialization phase, specifically related to Reanimated and Hermes runtime. The crash appears to be related to a race condition during initialization where multiple threads are trying to access the Reanimated runtime simultaneously.

The app works perfectly in development environment and build. Its only when I build production and submit to Testflight do I run into this crashing behavior

The crash manifests in Thread 9 (Hermes thread) during HadesGC operations. This consistently happens on app launch in the production build.

Initially, this issue occurred with Expo SDK 51 and react-native-reanimated 3.10. I attempted to resolve it by upgrading to Expo SDK 52 and react-native-reanimated 3.16.1, but the crash persists with the same pattern.

Crash Log Details

Key parts of the stack trace:

14  Mindara worklets::ReanimatedRuntime::make(...) + 112 (ReanimatedRuntime.cpp:31)
15  Mindara worklets::makeRuntime(...) + 20 (WorkletRuntime.cpp:46)
16  Mindara worklets::WorkletRuntime::WorkletRuntime(...)

Thread 9 also shows:

0   hermes                        	0x00000001049a2c40 hermes::vm::HadesGC::HeapSegment::setCellHead(hermes::vm::GCCell const*, unsigned long) + 64
1   hermes                        	0x00000001049a6c0c hermes::vm::HadesGC::OldGen::search(unsigned int) + 376
[...]

Full crash log can be provided if needed.

Steps to Reproduce

  1. Install app from TestFlight
  2. Launch app
  3. App crashes immediately after launch (consistently reproducible)

Environment

Current Environment:

  • Expo SDK: 52.0.0
  • Architecture: Old Architecture
  • Build type: Release (TestFlight)
  • Device: iPhone 13 Pro
  • OS Version: iOS 18.1.1

Previously tested on:

  • Expo SDK: 51
  • Reanimated: 3.10
  • (Same crash pattern observed)

Additional Context

The app is using several native modules that need to initialize on startup:

  • react-native-reanimated
  • @superwall/react-native-superwall
  • react-native-track-player

These all need to initialize properly with the JS runtime during app launch.

Code

// Current initialization approach in App.tsx
useEffect(() => {
  async function prepare() {
    try {
      await waitForReanimatedInit();
      console.log('✅ Reanimated initialized');
      
      const apiKey = Platform.OS === "ios" 
        ? "pk_xxx"
        : "pk_xxx";
      
      await Superwall.configure(apiKey);
      console.log('✅ Superwall configured');
      
      await setupTrackPlayer();
      console.log('✅ Track player initialized');

    } catch (e) {
      console.warn('❌ Error during app initialization:', e);
      Sentry.captureException(e);
    }
  }

  prepare();
}, []);

Attempted Solutions

  • Upgraded from Expo SDK 51 to 52
  • Upgraded react-native-reanimated from 3.10 to 3.16.1
  • Verified all dependencies are up to date
  • Confirmed crash happens consistently in production but not in development
  • Added error handling and logging
  • Implemented sequential initialization

Steps to reproduce

  1. Install app from TestFlight
  2. Launch app
  3. App crashes immediately after launch (consistently reproducible)

Snack or a link to a repository

happens immediately on launch so hard to reproduce

Reanimated version

3.16.1

React Native version

0.76.5

Platforms

iOS

JavaScript runtime

Hermes

Workflow

Expo Dev Client

Architecture

Paper (Old Architecture)

Build type

None

Device

Real device

Device model

No response

Acknowledgements

Yes

Copy link

Hey! 👋

It looks like you've omitted a few important sections from the issue template.

Please complete Description section.

@github-actions github-actions bot added Missing info The user didn't precise the problem enough Missing repro This issue need minimum repro scenario Platform: iOS This issue is specific to iOS labels Dec 29, 2024
Copy link

Hey! 👋

The issue doesn't seem to contain a minimal reproduction.

Could you provide a snack or a link to a GitHub repository under your username that reproduces the problem?

@guillaumehcht
Copy link

I have the same thing happening for me on Android build! Did you found a solution for it @lorddegenx ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Missing info The user didn't precise the problem enough Missing repro This issue need minimum repro scenario Platform: iOS This issue is specific to iOS
Projects
None yet
Development

No branches or pull requests

2 participants