You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
App version(s): 9.4.88-0 to 9.5.12-1, spread across builds (1 to 3 users each)
Affected route(s) (parameterized): none. The crash happens while the JS bundle loads, before any screen renders.
Mechanism: TombstoneMerged (SIGABRT), level fatal
Stack trace (top frames, first-party only)
com.facebook.react.common.JavascriptException: [runtime not ready]: Error: Cannot find native module 'ExpoAudio'
requireNativeModule
metroRequire chain (module initialization while the bundle loads)
global
facebook::react::JsErrorHandler::handleErrorWithCppPipeline (JsErrorHandler.cpp:403)
facebook::react::ReactInstance::loadScript lambda (ReactInstance.cpp:268)
std::terminate -> abort (SIGABRT)
Suspected cause
src/libs/Sound/index.native.ts imports expo-audio and calls setAudioModeAsync when the module loads. Startup code imports it (for example src/libs/actions/App.ts), so the bundle needs the ExpoAudio native module during its first evaluation. On some HybridApp Android launches that module is not registered, so requireNativeModule throws before the runtime is ready and the app aborts.
Reproduction
Unknown. See the Sentry events linked from the Sentry issue.
Please re-state the problem that we are trying to solve in this issue.
On Android HybridApp builds, the app crashes instantly on startup with a fatal Cannot find native module 'ExpoAudio' error because the audio module is being invoked before the native runtime is fully ready.
What is the root cause of that problem?
The root cause is a synchronous, top-level execution of a native module method during the initial JS bundle evaluation.
In src/libs/Sound/index.native.ts, expo-audio (or expo-av) is imported and configured (via setAudioModeAsync) at the top-level scope of the file.
Because Sound is imported early in the app lifecycle (e.g., through src/libs/actions/App.ts), the JS engine evaluates this file synchronously during bundle load.
In the Android HybridApp environment, native module registration timings differ from standalone React Native apps. Accessing the ExpoAudio native module at the top level throws a fatal JavascriptException because requireNativeModule fires before the HybridApp has finished registering it, causing a SIGABRT startup abort.
What changes do you think we should make in order to solve the problem?
We need to defer the native audio initialization so it does not execute during the top-level bundle evaluation. We will lazily configure the audio mode only when a sound is actually about to be played, wrapped in a safety catch for the HybridApp context.
// src/libs/Sound/index.native.ts// ... existing imports ...letisAudioConfigured=false;functionconfigureAudio(){if(isAudioConfigured){return;}try{Audio.setAudioModeAsync({playsInSilentModeIOS: true,// ... existing configuration ...});isAudioConfigured=true;}catch(error){Log.hmmm('Failed to initialize ExpoAudio in HybridApp',{error});}}exportdefaultfunctionplaySound(soundFile){configureAudio();// Defer native module access until runtime// ... existing play logic ...}
What alternative solutions did you explore? (Optional)
A purely native alternative would be patching the Android HybridApp host code to ensure the ExpoAudio package is forced into the synchronous native PackageList before the JS engine boots. This was rejected because React Native best practices dictate that JS should never assume native modules are synchronously available at bundle-load time. Lazy-loading the initialization in JS is much safer, prevents brittle startup crashes, and keeps the fix entirely within the cross-platform codebase.
Please re-state the problem that we are trying to solve in this issue.
HybridApp on Android crashes during startup with a fatal SIGABRT because the JS bundle fails during evaluation with Cannot find native module 'ExpoAudio'.
What is the root cause of that problem?
In src/libs/Sound/index.native.ts, line 9 statically imports createAudioPlayer and setAudioModeAsync from expo-audio, while line 25 immediately calls setAudioModeAsync during top-level bundle evaluation. The entry point of expo-audio evaluates AudioModule, which directly executes requireNativeModule('ExpoAudio'). Because startup code like src/libs/actions/App.ts imports src/libs/Sound, this executes before the native module registry is available in HybridApp Android, causing an unhandled synchronous exception.
What changes do you think we should make in order to solve the problem?
In src/libs/Sound/index.native.ts, retain only the type-only import import type {AudioSource} from 'expo-audio' at the module root, removing the value import of createAudioPlayer and setAudioModeAsync.
Remove the top-level evaluation of setAudioModeAsync at line 25.
Keep the existing guard order in playSound: check getIsMuted(), then verify SOUND_ASSETS[soundFile].
Inside playSound, dynamically require expo-audio wrapped in a try/catch block. If the native module cannot be resolved or loaded, log a warning and return early without throwing.
In the same lazy execution path, configure audio mode on first use via setAudioModeAsync({playsInSilentMode: false, shouldPlayInBackground: false, interruptionMode: 'mixWithOthers'}). If configuration fails, catch the error, reset any memoized state to avoid poisoning future attempts, and return before creating the audio player.
Guard player creation and playback with try/catch to ensure sound failures fail silently without crashing the app.
What alternative solutions did you explore? (Optional)
Earlier proposals failed by only moving setAudioModeAsync into a lazy helper while leaving the static value import import {createAudioPlayer, setAudioModeAsync} from 'expo-audio' at module scope. This still crashes on bundle load because expo-audio executes requireNativeModule('ExpoAudio') immediately upon being imported. Deferring the runtime require entirely prevents the startup abort. It fails safely.
src/libs/Sound/index.native.ts statically imports expo-audio and also calls setAudioModeAsync at module top level. expo-audio runs requireNativeModule('ExpoAudio') as soon as it is evaluated. @libs/Sound is imported by startup code such as src/libs/actions/App.ts and Session/index.ts, so that native lookup happens during the first bundle evaluation. If the native module isn't registered yet in a HybridApp launch, the error is thrown with no handler and the app aborts. Sound is not needed to start the app, but it can currently crash it.
What changes do you think we should make in order to solve the problem?
In src/libs/Sound/index.native.ts, remove the runtime import of expo-audio (keep import type only) and remove the top-level setAudioModeAsync call.
Add a small lazy loader that runs on first play. It loads expo-audio with a dynamic import() inside try/catch, caches the result, and calls setAudioModeAsync once. The cached promise replaces audioModeConfigured.
In playSound, call await loadAudio(). If it returns null, return silently, and log it with Log.warn. Otherwise use createAudioPlayer from the loaded module.
The existing getIsMuted check and the withMinimalExecutionTime wrapper stay as they are.
Add a unit test in tests/unit that mocks expo-audio to throw on load. It checks that importing @libs/Sound does not throw and that playSound resolves without error. A second test checks that audio mode is configured once, before the first player is created.
What alternative solutions did you explore? (Optional)
Wrap the top-level import in try/catch with require. This works, but it still does native lookups at startup and it is harder to type than a lazy loader.
Fix the native HybridApp module registration. That is probably the deeper reason the module goes missing, but it can't be reproduced here. The JS side should not crash the app over a notification sound either way.
Please re-state the problem that we are trying to solve in this issue.
HybridApp on Android crashes during application startup with a fatal SIGABRT / Tombstone crash: com.facebook.react.common.JavascriptException: [runtime not ready]: Error: Cannot find native module 'ExpoAudio'
thrown while the JS bundle is being evaluated during ReactInstance::loadScript.
What is the root cause of that problem?
In src/libs/Sound/index.native.ts, line 9 statically imports createAudioPlayer, setAudioModeAsync from expo-audio:
Core startup modules, including src/libs/actions/App.ts and src/libs/actions/Session/index.ts, import {clearSoundAssetsCache} from '@libs/Sound'. Therefore, Sound/index.native.ts is evaluated immediately when Metro loads and runs the initial JS bundle.
During the initial script evaluation on Android HybridApp launches, requireNativeModule('ExpoAudio') is invoked synchronously before the native JSI/modules runtime is fully ready and registered.
Because the error occurs at module top-level during bundle evaluation (ReactInstance::loadScript), it cannot be caught by any React ErrorBoundary, triggering facebook::react::JsErrorHandler::handleErrorWithCppPipeline and terminating the process via std::terminate -> abort() (SIGABRT).
What alternative solutions did you explore? (Optional)
Calling setAudioModeAsync inside an App.ts lifecycle hook was explored, but static imports of expo-audio still trigger module-level initialization code in expo-audio/src/index.ts. Lazy dynamic import (import('expo-audio')) on demand when sound is actually requested completely isolates startup from audio native module readiness.
What changes do you think we should make in order to solve the problem?
In src/libs/Sound/index.native.ts:
Remove the static import of expo-audio (createAudioPlayer, setAudioModeAsync).
Activity
melvin-bot commentedon Oct 20, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @ikevin127 (
External)[-][Sentry: APP-MD4] HybridApp Android: startup abort, "Cannot find native module 'ExpoAudio'"[/-][+][$175] [Sentry: APP-MD4] HybridApp Android: startup abort, "Cannot find native module 'ExpoAudio'"[/+]melvin-bot commentedon Oct 20, 2026
Job added to Upwork: https://www.upwork.com/jobs/~022112637793222357815
juni2003 commentedon Oct 20, 2026
Contributor details
Your Expensify account email: juni.xatti@gmail.com
Upwork Profile Link: https://www.upwork.com/freelancers/~01867ae3203c9b7815?mp_source=share
Proposal
Please re-state the problem that we are trying to solve in this issue.
On Android HybridApp builds, the app crashes instantly on startup with a fatal
Cannot find native module 'ExpoAudio'error because the audio module is being invoked before the native runtime is fully ready.What is the root cause of that problem?
The root cause is a synchronous, top-level execution of a native module method during the initial JS bundle evaluation.
src/libs/Sound/index.native.ts,expo-audio(orexpo-av) is imported and configured (viasetAudioModeAsync) at the top-level scope of the file.Soundis imported early in the app lifecycle (e.g., throughsrc/libs/actions/App.ts), the JS engine evaluates this file synchronously during bundle load.ExpoAudionative module at the top level throws a fatalJavascriptExceptionbecauserequireNativeModulefires before the HybridApp has finished registering it, causing aSIGABRTstartup abort.What changes do you think we should make in order to solve the problem?
We need to defer the native audio initialization so it does not execute during the top-level bundle evaluation. We will lazily configure the audio mode only when a sound is actually about to be played, wrapped in a safety catch for the HybridApp context.
What alternative solutions did you explore? (Optional)
A purely native alternative would be patching the Android HybridApp host code to ensure the
ExpoAudiopackage is forced into the synchronous nativePackageListbefore the JS engine boots. This was rejected because React Native best practices dictate that JS should never assume native modules are synchronously available at bundle-load time. Lazy-loading the initialization in JS is much safer, prevents brittle startup crashes, and keeps the fix entirely within the cross-platform codebase.melvin-bot commentedon Oct 20, 2026
✅ Contributor details stored successfully. Thank you for contributing to Expensify!
taieddie commentedon Oct 20, 2026
Contributor details
Your Expensify account email: taieddie8@gmail.com
Upwork Profile Link: https://www.upwork.com/freelancers/~01af851c9a7f771775
Proposal
Please re-state the problem that we are trying to solve in this issue.
HybridApp on Android crashes during startup with a fatal SIGABRT because the JS bundle fails during evaluation with
Cannot find native module 'ExpoAudio'.What is the root cause of that problem?
In
src/libs/Sound/index.native.ts, line 9 statically importscreateAudioPlayerandsetAudioModeAsyncfromexpo-audio, while line 25 immediately callssetAudioModeAsyncduring top-level bundle evaluation. The entry point ofexpo-audioevaluatesAudioModule, which directly executesrequireNativeModule('ExpoAudio'). Because startup code likesrc/libs/actions/App.tsimportssrc/libs/Sound, this executes before the native module registry is available in HybridApp Android, causing an unhandled synchronous exception.What changes do you think we should make in order to solve the problem?
src/libs/Sound/index.native.ts, retain only the type-only importimport type {AudioSource} from 'expo-audio'at the module root, removing the value import ofcreateAudioPlayerandsetAudioModeAsync.setAudioModeAsyncat line 25.playSound: checkgetIsMuted(), then verifySOUND_ASSETS[soundFile].playSound, dynamically requireexpo-audiowrapped in a try/catch block. If the native module cannot be resolved or loaded, log a warning and return early without throwing.setAudioModeAsync({playsInSilentMode: false, shouldPlayInBackground: false, interruptionMode: 'mixWithOthers'}). If configuration fails, catch the error, reset any memoized state to avoid poisoning future attempts, and return before creating the audio player.What alternative solutions did you explore? (Optional)
Earlier proposals failed by only moving
setAudioModeAsyncinto a lazy helper while leaving the static value importimport {createAudioPlayer, setAudioModeAsync} from 'expo-audio'at module scope. This still crashes on bundle load becauseexpo-audioexecutesrequireNativeModule('ExpoAudio')immediately upon being imported. Deferring the runtime require entirely prevents the startup abort. It fails safely.melvin-bot commentedon Oct 20, 2026
✅ Contributor details stored successfully. Thank you for contributing to Expensify!
haiquywork commentedon Oct 21, 2026
Proposal
What is the root cause of that problem?
src/libs/Sound/index.native.tsstatically importsexpo-audioand also callssetAudioModeAsyncat module top level.expo-audiorunsrequireNativeModule('ExpoAudio')as soon as it is evaluated.@libs/Soundis imported by startup code such assrc/libs/actions/App.tsandSession/index.ts, so that native lookup happens during the first bundle evaluation. If the native module isn't registered yet in a HybridApp launch, the error is thrown with no handler and the app aborts. Sound is not needed to start the app, but it can currently crash it.App/src/libs/Sound/index.native.ts
Lines 9 to 25 in 16d77a9
App/src/libs/actions/App.ts
Line 10 in 16d77a9
What changes do you think we should make in order to solve the problem?
src/libs/Sound/index.native.ts, remove the runtime import ofexpo-audio(keepimport typeonly) and remove the top-levelsetAudioModeAsynccall.expo-audiowith a dynamicimport()inside try/catch, caches the result, and callssetAudioModeAsynconce. The cached promise replacesaudioModeConfigured.playSound, callawait loadAudio(). If it returns null, return silently, and log it withLog.warn. Otherwise usecreateAudioPlayerfrom the loaded module.getIsMutedcheck and thewithMinimalExecutionTimewrapper stay as they are.tests/unitthat mocksexpo-audioto throw on load. It checks that importing@libs/Sounddoes not throw and thatplaySoundresolves without error. A second test checks that audio mode is configured once, before the first player is created.What alternative solutions did you explore? (Optional)
require. This works, but it still does native lookups at startup and it is harder to type than a lazy loader.jloa-dev commentedon Oct 21, 2026
Contributor details
Your Expensify account email: jloa.dev@gmail.com
Upwork Profile Link: https://www.upwork.com/freelancers/~0163955a2ba221e513
Proposal
Please re-state the problem that we are trying to solve in this issue.
HybridApp on Android crashes during application startup with a fatal SIGABRT / Tombstone crash:
com.facebook.react.common.JavascriptException: [runtime not ready]: Error: Cannot find native module 'ExpoAudio'thrown while the JS bundle is being evaluated during
ReactInstance::loadScript.What is the root cause of that problem?
src/libs/Sound/index.native.ts, line 9 statically importscreateAudioPlayer, setAudioModeAsyncfromexpo-audio:src/libs/actions/App.tsandsrc/libs/actions/Session/index.ts, import{clearSoundAssetsCache} from '@libs/Sound'. Therefore,Sound/index.native.tsis evaluated immediately when Metro loads and runs the initial JS bundle.requireNativeModule('ExpoAudio')is invoked synchronously before the native JSI/modules runtime is fully ready and registered.ReactInstance::loadScript), it cannot be caught by any React ErrorBoundary, triggeringfacebook::react::JsErrorHandler::handleErrorWithCppPipelineand terminating the process viastd::terminate -> abort() (SIGABRT).What alternative solutions did you explore? (Optional)
Calling
setAudioModeAsyncinside anApp.tslifecycle hook was explored, but static imports ofexpo-audiostill trigger module-level initialization code inexpo-audio/src/index.ts. Lazy dynamic import (import('expo-audio')) on demand when sound is actually requested completely isolates startup from audio native module readiness.What changes do you think we should make in order to solve the problem?
In
src/libs/Sound/index.native.ts:expo-audio(createAudioPlayer,setAudioModeAsync).const audioModeConfigured = setAudioModeAsync(...).What automated tests can you add to prevent this from re-occurring?
Add a test in
tests/unit/SoundTest.tsverifying that:@libs/Sounddoes not trigger any native calls or throw even when native audio modules are unavailable.playSoundsafely handles failure without crashing when native modules reject.22 remaining items
melvin-bot commentedon Oct 31, 2026
Payment Summary
BugZero Checklist (@mallenexpensify)
[-][Due for payment 2026-10-31] [$175] [Sentry: APP-MD4] HybridApp Android: startup abort, "Cannot find native module 'ExpoAudio'"[/-][+][Due for payment 2026-11-04] [$175] [Sentry: APP-MD4] HybridApp Android: startup abort, "Cannot find native module 'ExpoAudio'"[/+]mallenexpensify commentedon Nov 3, 2026
Paying in two days
ikevin127 commentedon Nov 6, 2026
mallenexpensify commentedon Nov 7, 2026
Payment Summary
Contributor: @ikevin127 due $175 via NewDot
Contributor+: @daledah due $175 via NewDot
quinthar commentedon Nov 8, 2026
Approved $175 to @ikevin127