π Navigating away on React Native 0.78+, XCode 26, and React Native Vision Camera v4.7.1 freezes the app
What's happening?
I've noticed an odd bug where when I build the app with:
- Xcode 26
- React Native 0.78+
- React Navigation 7.x+
- React Native Vision Camera v4.7.1
CodeScannerproperty passed in- Isolated on a straightforward app
Running on a real device, when navigating away, the app freezes for 5+ seconds, either on navigation or after navigating away.
Some notable things:
CodeScannerproperty being passed in, this is reproducible 10/10 times, and freezes 5+ secondsCodeScannerproperty NOT passed in, this is reproducible 5/10 times, but the freezing is < 2 seconds- When the Vision Camera is not rendered, the freeze does not occur
Can you reproduce this issue in the VisionCamera Example app?
UPDATE: I have tested with react navigation 6, and it is still freezing. so it may be related to the react-native version + Xcode 26
No, because the example app is using react native 75 and react navigation 6
Reproduceable Code
https://github.com/daniel112/react-native-vision-freeze-demo
Relevant log output
there are no obvious signs or useful output logs on XCode, but
10:08:59.988: [info] πΈ VisionCamera.configureOutputOrientation(_:): Updating Outputs rotation: portrait...
10:08:59.988: [info] πΈ VisionCamera.configureOutputs(configuration:): Successfully configured all outputs!
10:08:59.988: [info] πΈ VisionCamera.setTargetOutputOrientation(_:): Setting target output orientation from device to device...
10:09:00.382: [info] πΈ VisionCamera.init(frame:session:): Preview Layer started previewing.
10:09:00.383: [info] πΈ VisionCamera.configure(_:): Beginning AudioSession configuration...
10:09:00.383: [info] πΈ VisionCamera.configureAudioSession(configuration:): Configuring Audio Session...
10:09:00.384: [info] πΈ VisionCamera.configure(_:): Committed AudioSession configuration!
10:09:00.384: [info] πΈ VisionCamera.configure(_:): Beginning Location Output configuration...
10:09:00.385: [info] πΈ VisionCamera.configure(_:): Finished Location Output configuration!
Camera Device
{
"maxZoom": 123.75,
"minExposure": -8,
"supportsRawCapture": false,
"name": "Back Dual Wide Camera",
"position": "back",
"isMultiCam": true,
"supportsFocus": true,
"minZoom": 1,
"hasTorch": true,
"sensorOrientation": "portrait",
"hasFlash": true,
"supportsLowLightBoost": false,
"id": "com.apple.avfoundation.avcapturedevice.built-in_video:6",
"neutralZoom": 2,
"minFocusDistance": 2,
"maxExposure": 8,
"physicalDevices": [
"ultra-wide-angle-camera",
"wide-angle-camera"
],
"hardwareLevel": "full",
"formats": []
}
Device
iPhone 16 (26.0)
VisionCamera Version
4.7.2
Can you reproduce this issue in the VisionCamera Example app?
No, I cannot reproduce the issue in the Example app
Additional information
- [x] I am using Expo
- [ ] I have enabled Frame Processors (react-native-worklets-core)
- [x] I have read the Troubleshooting Guide
- [x] I agree to follow this project's Code of Conduct
- [x] I searched for similar issues in this repository and found none.
Guten Tag, Hans here.
[!NOTE] New features, bugfixes, updates and other improvements are all handled mostly by
@mrousavyin his free time. To support@mrousavy, please consider π sponsoring him on GitHub π. Sponsored issues will be prioritized.
this seems to be more prominent when I build on xcode 26 vs xcode 16. another theory is that it is because of the new Fabric architecture being turned on
I've got the exact same issue. any solutions?
I'm experiencing this on:
- react-native 0.81.4
- vision-camera 4.7.2
- ios only
- real device
- xcode 26
It works fine on xcode 16.
Getting the same issue myself, but also in Xcode 16.4 as well
@mrousavy do you think this is an issue with react native vision camera?
Well does it work if you remove the camera or keep isActive={false}?
Well does it work if you remove the camera or keep isActive={false}?
Yes, the app does not freeze if the Camera is removed completely or isActive=false
Same issue, vision-camera - 4.7.0, ios - 26 (it happens only with ios 26). Even if it's compiled with xcode 26 and launched on an ios 18 device, everything is fine.
Yes, the app does not freeze if the Camera is removed completely or isActive=false
Hi @mrousavy, just wanted to check in if this is something that is being looked at? it seems like a big issue.
Hey - nope, I currently don't have the time to look at this. All my (very limited) free time is currently dedicated to Nitro and react-native-mmkv. In the near future I can focus on VisionCamera again.
Why do I need to manually zoom in on the image for iOS to recognize it? Even when using the camera, it still fails to recognize. Is this due to some properties or settings not being configured properly, or is it just that the recognition accuracy is inherently limited? Why canβt it automatically focus on a point like Alipay does, recognizing the image without needing to zoom in or out? Is there some limitation or missing feature? @mrousavy @daniel112 @atm98 @gigilibala
I opened PR #3650 that fixes it during my testing, but I don't know Swift. Seems like a low chance of any regressions but review is appreciated @mrousavy .
have unexpectedly run into this issue too
same behaviour - navigate away, freezes until the camera goes inactive
I opened PR #3650 that fixes it during my testing, but I don't know Swift. Seems like a low chance of any regressions but review is appreciated @mrousavy .
Hi @EthanDM ,
Thanks for your fix! I've successfully integrated it into our React Native app and can confirm it's working well. The fix resolved the app freeze issue we were experiencing on iOS.
We are using:
- React Native: 0.78.0
- XCode: 26
- iOS: Tested on physical device (iOS 26.1)