How the Expo handler stubs work
mainThe expo-stubs module provides mock implementations of expo-modules-core interfaces, specifically Package and ReactNativeHostHandler.
In a real Expo project, the Expo handler (android/expo-handler/) is compiled against the actual expo-modules-core library. It uses a ReactNativeHostHandler to capture native exceptions that are otherwise swallowed by Expo's bridgeless error handling mechanism (ExpoReactHostDelegate.handleInstanceException).
These stubs are used during unit testing in RNSentryAndroidTester to provide these necessary interfaces at compile time in environments where Expo is not present.