Environment
- Expo SDK: 52.0.47
- React Native: 0.76.9
- React: 18.3.1
- @reactvision/react-viro: 2.43.3
- Platform: iOS (physical device)
- Build type: Custom Expo Dev Client && Release Build
Description
When navigating away from a screen with a ViroARSceneNavigator, the app crashes on iOS.
Xcode shows:
-[VROViewAR applicationWillResignActive:]: unrecognized selector sent to deallocated instance
Looks like the AR view is deallocated before the lifecycle observer is removed.
Steps to Reproduce
Open a screen with ViroARSceneNavigator
Let AR start
Navigate away (navigation.replace or goBack)
Swipe down from top of screen to bring up notifications or attempt to slide the app into background.
App crashes with the log above
Notes
Tried manual cleanup with:
arNavRef.current?.pause?.();
arNavRef.current?.exitViro?.();
arNavRef.current?.unloadScene?.();
Still crashes
✅ Happens every time when leaving an AR scene.